【发布时间】:2021-04-09 11:53:03
【问题描述】:
我在设置 Core ML 模型时遇到了一些问题...
Xcode 告诉我:“不推荐使用 init():改用 init(configuration:) 并适当地处理错误。”
这是我的代码:
guard let model = try? VNCoreMLModel(for: MobileNetV2().model) else {
fatalError("Unable to load the model")
}
let classificationRequest = VNCoreMLRequest(model: model, completionHandler: classificationCompleteHandler)
classificationRequest.imageCropAndScaleOption = VNImageCropAndScaleOption.centerCrop
visionRequests = [classificationRequest]
loopCoreMLUpdate()
}
我该如何解决?
非常感谢您的回答!
洛伊克
【问题讨论】: