Skip to content

Instantly share code, notes, and snippets.

@AkiyonKS
Created August 9, 2022 05:13
Show Gist options
  • Save AkiyonKS/07878379589fb723ce8b4373072e5ef4 to your computer and use it in GitHub Desktop.
Save AkiyonKS/07878379589fb723ce8b4373072e5ef4 to your computer and use it in GitHub Desktop.
converter = tf.lite.TFLiteConverter.from_keras_model(model_for_export)
pruned_tflite_model = converter.convert()
_, pruned_tflite_file = tempfile.mkstemp('.tflite')
with open(pruned_tflite_file, 'wb') as f:
f.write(pruned_tflite_model)
print('Saved pruned TFLite model to:', pruned_tflite_file)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment