Search code examples
kerascoremlcoremltools

How should I give label names to the model output with coreML convert


I have build a model using keras and I want to convert it to coreML using this function :

import coremltools
coreml_model = coremltools.converters.keras.convert(model)
coreml_model.save(‘myModel’)

The output of my model is a 10 neurons layer to predict 10 classes. My issue is that I would like to give the label name associated with each neuron classA, classB, etc.

The doc shows a lot of parameters (https://apple.github.io/coremltools/generated/coremltools.converters.keras.convert.html) but I can't understand which one to use : output_names, predicted_feature_name, or predicted_probabilities_output?


Solution

  • Never mind... I just did not read the doc properly.. I had to use the class_labels parameters.