Skip to content

Instantly share code, notes, and snippets.

@Tony607
Created May 19, 2019 12:23
Show Gist options
  • Select an option

  • Save Tony607/c3fcbcfb9051fe14cd85fe9f743c75fc to your computer and use it in GitHub Desktop.

Select an option

Save Tony607/c3fcbcfb9051fe14cd85fe9f743c75fc to your computer and use it in GitHub Desktop.
How to compress your Keras model x5 smaller with TensorFlow model optimization | DLology
# Create the .tflite file
tflite_model_file = "/tmp/sparse_mnist.tflite"
converter = tf.lite.TFLiteConverter.from_keras_model_file(pruned_keras_file)
tflite_model = converter.convert()
with open(tflite_model_file, "wb") as f:
f.write(tflite_model)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment