Support exports for Apple's new mlmodel format in Keras 2
See original GitHub issueApple’s recently announced support for ML models in iOS11 through a specific format. (WWC17 video, docs) They provide an opensource conversion python package called coremltools that currently only support conversion from Keras 1.2.2 models. (see in the version of the package I hosted). They seem to expect the open source community to implement conversion from other formats…
Is there any plan from Keras to do so? Else what do you suggest? The code for Keras 1.2.2 is roughly 2000 lines. I guess there’s probably a bunch of things that can be reused to support conversion from Keras 2, but I don’t have the expertise around Keras’s model saving format to make a PR 😦
I tried to load a model saved by Keras 2 with coremltools and that failed.
I also opened a question on SO and hosted the package code on github to make the discussion easier: https://github.com/gsabran/coremltools
Extending the save API to something like save(self, filepath, overwrite=True, include_optimizer=True, format='keras' or 'mlmodel')
would be great.
Issue Analytics
- State:
- Created 6 years ago
- Comments:16
import coremltools coreml_model = coremltools.converters.keras.convert(‘multi_digits_keras.h5’) coreml_model.save(‘mnist_cnn_keras.mlmodel’)
it returns: AttributeError: ‘module’ object has no attribute ‘convert’, Could you give me some advices?
Keras 2.0 support is already there (released yesterday), with coremltools v.0.4.0
Also, refer to newest comments on Apple Developer Forums