Coreml: Model class has not been generated yet

2.3k views Asked by At

I've converted model from keras with coremltools, added it to project and added to targets. And then when i'm pressing on model in navigator in Model Class section i'm getting "Model class has not been generated yet.". What does it mean?

enter image description here

4

There are 4 answers

0
mirt On BEST ANSWER

Cited from apple dev forum:

Xcode has stopped automatically adding the coreml model to the build settings of your project. To solve, go to your target, go to build phases, find compile sources and add your coreml model. After this, the model class is generated.

1
Matthijs Hollemans On

It means you first need to build your project (Cmd+B). The model class is generated as part of the build process.

0
Vittal Pai On

For me even though I have added it in the compile sources section of build settings didn't worked.

After many hours, Cracked it by setting the "CoreML Code Generation Language" setting in project build settings to something else than none or to the specific language solved the issue.

0
Jiang On

target -> Build Setting -> CoreML Model Compiler - Code Generation -> CoreML Generated Model Inherits NSObject -> YES

enter image description here