coreML xcode 12

I have model converted from Keras with a custom layer at the end that was working pretty well in the Xcode 11, but it does not in Xcode 12. The prediction from the model gives nil value.
I have to say I didnt converted the models with the latest version of coremltools, should I do that?
Is there any quick fix to the prediction problem in Xcode 12?

Thanks,
Arash

Replies

I have had all kinds of weird errors with custom layers in Xcode 12, including the app crashing when trying to load the model.

My solution: use coremlc from Xcode 11 to compile the model by hand, add the mlmodelc folder to your project, remove the mlmodel file from the project, and load the model by passing in the URL to the mlmodelc folder in your app bundle.

You will also need to copy&paste the auto-generated source file from Xcode 11 into your Xcode 12 project (since you no longer have an mlmodel, it also doesn't generate the source file anymore).