Skip to content

Instantly share code, notes, and snippets.

@nbertagnolli
Created February 23, 2020 18:32
Show Gist options
  • Save nbertagnolli/1e80f9b3b1fcef0956db5eba65cbc83e to your computer and use it in GitHub Desktop.
Save nbertagnolli/1e80f9b3b1fcef0956db5eba65cbc83e to your computer and use it in GitHub Desktop.
Convert Keras Model to CoreML
import coremltools
class_labels = ['airplane', 'automobile' ,'bird ','cat ','deer ','dog ','frog ','horse ','ship ','truck']
// model is just a trained keras model.
coreml_model = coremltools.converters.keras.convert(model,
input_names=['image'],
image_input_names='image',
class_labels=class_labels)
coreml_model.save('CIFAR.mlmodel')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment