Created
February 23, 2020 18:32
-
-
Save nbertagnolli/1e80f9b3b1fcef0956db5eba65cbc83e to your computer and use it in GitHub Desktop.
Convert Keras Model to CoreML
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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