Create ML Multi-Label Image Classifier will not train, throws error: "Unexpected Error"

Hello everyone, I am new to using Create ML, but am running up against a problem where the error is not descriptive, and I can not figure out what might be causing it. I am fairly sure my data is formatted properly, as in the CreateML software, it detects the images and shows me a bar graph of how many images belong to each label. But when it comes to actually training, the moment I press the "Train" button, it shows an error with the message: "Unexpected Error".

I have also attempted to create and train the model programmatically, and that actually works! The framework requires that the JSON be named "annotations.json" instead of "annotation.json" and that the key representing the name of image be changed to "filename" from "image", but other than that, the data is the same. I tried to use the software with the changes I made to the JSON for use in the framework, but if I try that, it won't even parse the data, so I am fairly sure that my data is formatted correctly.

I would prefer to use the app rather than do everything programmatically, because it presents the data in a much more digestible way.

Has anyone else come up against this issue or a similar issue. I should note that I am running the latest Beta of MacOS Sonoma and Xcode.

Answered by in 763867022

Thanks for your help with this, this was resolved in the latest Xcode 15, Beta 6. A much more descriptive error of "The training data source should contain more images for each class to enable auto split to include every class." is now shared in this case.

can you share you Xcode and macOS beta versions?

and if possible, share a toy dataset that can reproduce it

I was wondering if this issue has been resolved?

I am also getting an "Unexpected Error" when I use CreateML to train a model.

In my case, the model is an Action Classifier. CreateML completes the feature extraction phase and then gives me an "Unexpected Error".

I should note that I am running MacOS Ventura 13.4 and Xcode 14.3.1.

Any help is appreciated.

Can anyone share a simple working annotations.json format for the multi-label image classification template? I tried to work out from description above but keep getting 'Data Analysis Stopped' message when adding my training data folder. I think this means something wrong with annotations file.

Hi,

same setup with same issue here.. Stellar, can you share how you managed to train the model programmatically? I could check if my annotations file and the images are at least working ...

Greets

Accepted Answer

Thanks for your help with this, this was resolved in the latest Xcode 15, Beta 6. A much more descriptive error of "The training data source should contain more images for each class to enable auto split to include every class." is now shared in this case.

I'm getting a failure on export using the exact transformer used in this guide https://developer.apple.com/documentation/createml/creating-a-multi-label-image-classifier

ComposedTransformer<ComposedTransformer<ImageReader, ImageFeaturePrint>, FullyConnectedNetworkMultiLabelClassifierModel> The transformer is not representable as a CoreML model (ImageReader).

I'm guessing this is just a misleading error?

In this intro with no runnable examples https://developer.apple.com/videos/play/wwdc2022/10019/ also noticed this line

try estimator.write(transformer, to: parametersURL) which writes a .pkg file which I'm guessing is for instantiating the estimator

Create ML Multi-Label Image Classifier will not train, throws error: "Unexpected Error"
 
 
Q