question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support exports for Apple's new mlmodel format in Keras 2

See original GitHub issue

Apple’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:closed
  • Created 6 years ago
  • Comments:16

github_iconTop GitHub Comments

13reactions
Fenomscommented, Jul 16, 2017

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?

6reactions
karolkuleszacommented, Jun 29, 2017

Keras 2.0 support is already there (released yesterday), with coremltools v.0.4.0

Also, refer to newest comments on Apple Developer Forums

Read more comments on GitHub >

github_iconTop Results From Across the Web

Get models on device using Core ML Converters - WWDC20
With Core ML you can bring incredible machine learning models to your app and run them entirely on-device. And when you use Core...
Read more >
Core ML | Apple Developer Forums
Export and use Create ML model in runtime. Hello! In my iPhone app, I have created a ... Core ML Performance Report not...
Read more >
Running Keras models on iOS with CoreML - PyImageSearch
Today, we're going to take this trained Keras model and deploy it to an iPhone and iOS app using what Apple has dubbed...
Read more >
Integrating trained models into your iOS app using Core ML
One big thing to come out of Apple's WWDC 2017 was the new Core ML framework ... model using Keras with TensorFlow and...
Read more >
CoreML NLC with Keras/TensorFlow and Apple ... - Medium
Importer: A Swift multiplatform console app to import Intents and Utterances from different formats (could run on macOS and Linux) ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found