CoreMLTools crash Python when converting Keras (.h5) model

Hi there,


I have been trying to convert a Keras trained model (.h5) to a coreMLModel .mlmodel.

Everytime I run this code, python crashes unexpectedly:


import coremltools

coreml_model = coremltools.converters.keras.convert('second_try.h5')
print ('Done')


coreml_model.save('second_try.mlmodel')


'Done' is not printed, hence the converter seems to crash.


Any ideas where I am going wrong?

I tried converting other Keras models and am experiencing the same crash.


I am using Keras 2.0.6 and tensorflow 1.2.1


Many thanks!

Replies

If Python crashes, there should be an error message. What is this message?


Without having seen the error message, the most likely culprit is that you're using the homebrew version of Python instead of the system Python.