Skip to content

Instantly share code, notes, and snippets.

@nodamu
Last active April 16, 2019 10:48
Show Gist options
  • Save nodamu/1d0e4885ae1905f76a8b4463aa5a5019 to your computer and use it in GitHub Desktop.
Save nodamu/1d0e4885ae1905f76a8b4463aa5a5019 to your computer and use it in GitHub Desktop.
kerasToTflite.py
import tensorflow as tf
keras_model = "tomato_weights_best.hdf5"
tflite_model = "tomato_model.tflite"
converter = tf.lite.TFLiteConverter.from_keras_model_file(keras_model)
tflite_model = converter.convert()
open(tflite_model, "wb").write(tflite_model)
@nodamu
Copy link
Author

nodamu commented Apr 16, 2019

Note the import statement, tflite has been moved from contrib

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment