Created
November 12, 2019 07:17
-
-
Save amansrivastava17/d91c5345c7945d69430e16cbd84e9795 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def convert_model_to_tflite(keras_model_path): | |
| tf.logging.set_verbosity( tf.logging.ERROR ) | |
| converter = tf.contrib.lite.TFLiteConverter.from_keras_model_file(keras_model_path ) | |
| converter.post_training_quantize = True | |
| tflite_buffer = converter.convert() | |
| open( 'model.tflite' , 'wb' ).write( tflite_buffer ) | |
| print( 'TFLite model created.') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment