How to Convert Keras model into Tensorflow lite

github logo ・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.

twitter logo DISCUSS
Classic DEV Post from Jan 17

25 years of coding, and I'm just beginning

I've come to a conclusion that I have nothing to show for my 25 years of coding. I am ready to begin and I have a plan.

Koji profile image
ex-Research Resident@NYU-ITP/software dev #ml #openFrameworks #creativecoding #python #reactjs Passionate about creative coding/code art/generative art.