Skip to content

Instantly share code, notes, and snippets.

@shubham0204
Created June 13, 2019 05:25
Show Gist options
  • Save shubham0204/d03ca0143497a733b0f934c835bf9bf0 to your computer and use it in GitHub Desktop.
Save shubham0204/d03ca0143497a733b0f934c835bf9bf0 to your computer and use it in GitHub Desktop.
new_model = tf.keras.Sequential( model.layers[ 1 : ] )
new_model.save( 'android/no_embedding_model.h5' )
converter = tf.lite.TFLiteConverter.from_keras_model_file( 'android/no_embedding_model.h5')
converter.post_training_quantize = True
tflite_buffer = converter.convert()
open( 'android/model.tflite' , 'wb' ).write( tflite_buffer )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment