Error preparing CoreML model: “<something>” is not supported for CoreML code generation

丶灬走出姿态 提交于 2019-12-24 03:42:51

问题


I am modifying the code from this tutorial and I'm getting this error:

Error preparing CoreML model "Resnet50.mlmodel" for code generation: Target's predominant language "Swift Interface" is not supported for CoreML code generation. Please set COREML_CODEGEN_LANGUAGE to preferred language

The project used to compile before with the "Places205-GoogLeNet" model.

Anyone else experiencing the same?


回答1:


In the project settings view for your app target, Change the setting COREML_CODEGEN_LANGUAGE to Swift.

The default setting Automatic is not working correctly in all cases in Xcode 9 beta.

This issue was also mentioned on the apple developer lists here.




回答2:


So basically if you have got more than one model XCode does not autogenerate the code automatically and complains with an error.

Removing the previous model from the resource folder solved the issue.

It looks like that an App can have only one model installed.



来源:https://stackoverflow.com/questions/44655629/error-preparing-coreml-model-something-is-not-supported-for-coreml-code-gen

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!