最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

CoreML model error happening in code. I need help troubleshooting this error resulting in my xcode app - Stack Overflow

programmeradmin0浏览0评论

I have been getting the following error messages on my Xcode App:

E5RT: Espresso exception: "Invalid state": MpsGraph backend validation on incompatible OS (11)
[Espresso::handle_ex_] exception=Espresso compiled without MPSGraph engine.
E5RT encountered an STL exception. msg = Espresso exception: "Invalid state": MpsGraph backend validation on incompatible OS.
E5RT: Espresso exception: "Invalid state": MpsGraph backend validation on incompatible OS (11)
[Espresso::handle_ex_] exception=Espresso compiled without MPSGraph engine.

The code that does the classification task is here:


import Foundation
import CoreML
import Vision
import CoreImage

struct Classifier {
    
    private(set) var results: String?
    
    mutating func detect(ciImage: CIImage) {
        
        //guard let model = try? VNCoreMLModel(for: SkinAI(configuration: MLModelConfiguration()).model)
        //guard let model = try? VNCoreMLModel(for: LungAI(configuration: MLModelConfiguration()).model)
        guard let model = try? VNCoreMLModel(for: resnet101_model(configuration: MLModelConfiguration()).model)
        else {
            return
        }
        
        let request = VNCoreMLRequest(model: model)
        
        let handler = VNImageRequestHandler(ciImage: ciImage, options: [:])
        
        try? handler.perform([request])
        
        guard let results = request.results as? [VNClassificationObservation] else {
            return
        }
        
        if let firstResult = results.first {
            self.results = firstResult.identifier
        }
        
    }
    
}

I am pretty new with Xcode and CoreML entirely and would like some help on how to troubleshoot/debug this error.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论