Difficulties Integrating Core ML Model into my App

Hello,

i have been working on a swift UI project and want to integrate my own ML Model from Create ML into the app.

My create ML Model is a tabular-Regressor Model wich works fine in the create ML Preview. Following this guide:

https://developer.apple.com/documentation/coreml/integrating_a_core_ml_model_into_your_app

i have tried to integrate the model into the app (Xcode 13.4.1). I load the file into the project navigator. When i try to create the model in the code with

let model = MyModelName()

i get the error

Cannot find 'MyModelName' in scope

Other Models (like the ones downloadable from apple) seem to get recognized. I get an information about using a different init method but at least not an error.

What am i doing wrong? Any ideas?

Thank You !

Rob

This is from the log:

Command CoreMLModelCodegen failed with a nonzero exit code

Command CoreMLModelCodegen failed with a nonzero exit code

That explains the issue you are facing but, it is not expected. Could you share a sample project on feedbackassistant.apple.com ? We can take a quick look and get back to you here.

I narrowed it down. It turns out the problem was in the trainingsdata (especially the title row): it contained some umlauts. While create ML was fine with that, Xcode was not. Removing them solved the problem. The model is now recognized in Xcode.

Difficulties Integrating Core ML Model into my App
 
 
Q