Skip to content

Instantly share code, notes, and snippets.

@qaixerabbas
Created May 26, 2021 17:09
Show Gist options
  • Save qaixerabbas/ef7588e9eb996cc45025dbed8acce6de to your computer and use it in GitHub Desktop.
Save qaixerabbas/ef7588e9eb996cc45025dbed8acce6de to your computer and use it in GitHub Desktop.
import tensorflow as tf
#load required libraries and functions such as load_model etc
model_path = './example.h5' #path to your model
tf_model = tf.keras.models.load_model( model_path )
converter = tf.lite.TFLiteConverter.from_keras_model( tf_model )
tf_lite_model = converter.convert()
open( 'facenet.tflite' , 'wb' ).write( tf_lite_model )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment