Search code examples
pythontensorflowcoreml

Can I convert a ".py" or ".ipynb" model/file created on Google Colab's Tensorflow to a coreML model/ file?


I created a CNN model on Google Colab's Tensorflow and downloaded the file as a ".py" file. How can I convert this file into a ".coreml" file?

Any advice is much appreciated!

Thank you!


Solution

  • Documentation on how to convert into Core ML's .mlmodels: https://developer.apple.com/documentation/coreml/converting_trained_models_to_core_ml

    For TensorFlow models, you need to convert it to frozen.pb model as an input for the convert function. Here are some examples: https://github.com/tf-coreml/tf-coreml/tree/master/examples