Anyone else having issues with the GM release with ML models and has a solution for this? I get the following error:
Type 'MLModel' has no member '__loadContents'
I have cleaned the Project + deleted derived data (this is a generated file that is put into the derived data folder)
I notice that the method should not be there for mac OS 10.15 which I use, but it there for some reason.
I also noticed that this API is still in beta while the GM is a production build? https://developer.apple.com/documentation/coreml/mlmodel
Should I regenerate the ML model?
Root cause of this is :
CoreML compiler in Xcode 12.0 GM is generating code that has symbols available only on macOS BigSur causing the compilation issue. If the goal is to build a catalyst or macOS-only app with Xcode 12.0
Steps to fix :
In my case I comment out :
class func load(contentsOf modelURL: URL, configuration: MLModelConfiguration = MLModelConfiguration(), completionHandler handler: @escaping (Swift.Result<Nudity, Error>) -> Void)
and
class func load(configuration: MLModelConfiguration = MLModelConfiguration(), completionHandler handler: @escaping (Swift.Result<Nudity, Error>) -> Void)
methods to fix swift file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With