3

I wanted to create an image classifier with create ML. However, when I build, I get this error.

The target and path are correct, but I don't know why I'm getting this error.

Tried to set the path correctly. But even if I set it to the correct path, I get this error.

Does anyone know anything about this?

Jerry
  • 41
  • 3

2 Answers2

3

What worked for me was making sure that I was testing the model on an actual device, not the simulator.(Make sure the path to the model is also correct)

txb4
  • 31
  • 4
0

Check file extension, it must be in your filepath string. Something like this: /var/.../classifier.mlmodelc not /var/.../classifier.

Also check that you're using this init method: init(fileURLWithPath path: String) for URL class not this init?(string: String).

Alex Sh.
  • 579
  • 5
  • 17