Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save tarun-ssharma/4107707cb5fd628af086c5ebbe29f7ef to your computer and use it in GitHub Desktop.
Save tarun-ssharma/4107707cb5fd628af086c5ebbe29f7ef to your computer and use it in GitHub Desktop.
import tensorflow as tf
output_directory = './saved_model'
converter = tf.lite.TFLiteConverter.from_saved_model(output_directory) # path to the SavedModel directory
tflite_model = converter.convert()
# Save the model.
with open('model.tflite', '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