loading...

How to Convert Keras model into Tensorflow lite

kojikanao profile image Koji (he/him) ・1 min read

I just found a great video for converting Keras model into Tensorflow lite model.

https://www.youtube.com/watch?v=IJt_veyTlv8

requirements

I asked about the version of Tensorflow to android daily life with ameer. He told me he was using tensorflow1.12.
So need to install that version

!pip uninstall tensorflow
!pip install tensorflow==1.12

code

from tensorflow.contrib import lite
converter = lite.TFLiteConverter.from_keras_model_file('/content/VGG_cross_validated.h5')
tfmodel = converter.convert()
open("model.tflite","wb").write(tfmodel)

I will try Tensorflow lite model with Edge-TPU.

Discussion

markdown guide
 

Thanks a lot! I have been searching for this for days.