I am making a image classification iOS app with Swift.
When I write
guard let model = try? VNCoreMLModel(for: SqueezeNet().model) else { return }
I got this warning:
'init()' is deprecated: Use init(configuration:) instead and handle errors appropriately.
How to get rid of it?
For me the code of an Apple sample project worked out:
guard let mlModel = try? YOLOv3(configuration: .init()).model,
let model = try? VNCoreMLModel(for: mlModel) else {
print("Failed to load detector!")
return
this was the code which gave me the warning:
guard let model = try? VNCoreMLModel(for: YOLOv3().model) else {
print("Could not load model")
return
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