"Use of unresolved identifier" with CoreMLModel

Viewed 3717

For some background: I'm using Swift 4 and Xcode 9 (beta). I'm trying to implement a CoreML Model in my app, however, for this line of code (which was placed in an IBAction func in my ViewController class):

let coreMLModel = testmodel2().model

I get an error that says "Use of unresolved identifier 'testmodel2'". I've read some of the other similar questions for this, and I made sure that my ViewController and my testmodel2.mlmodel file have the same target. Nothing else seems to be working.

4 Answers

While importing mlmodel into a Objective C project with Swift brigding header , than you had change the compile Language for CoreML from project build Setting from Automatic to Swift as shown in the pictureenter image description here

Related