问题
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