Skip to content

Instantly share code, notes, and snippets.

@ozgurshn
Created June 21, 2018 22:53
Show Gist options
  • Save ozgurshn/249c26757407530aee7492e20036c58a to your computer and use it in GitHub Desktop.
Save ozgurshn/249c26757407530aee7492e20036c58a to your computer and use it in GitHub Desktop.
def saveCoreMLModel(kerasModel):
coreml_model = coremltools.converters.keras.convert(kerasModel,
input_names=['input'],
output_names=['probs'],
image_input_names='input',
predicted_feature_name='predictedMoney',
class_labels = 'drive/Resnet/labels.txt')
coreml_model.save('resnet50custom.mlmodel')
print('CoreML model saved')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment