I got an keras(h5) file. I need to convert it to tflite?? I researched, First i need to go via h5 -> pb -> tflite (because h5 - tflite sometimes results in some issue)
This worked for me on Windows 10 using Tensorflow 2.1.0 and Keras 2.3.1
import tensorflow as tf model = tf.keras.models.load_model('model.h5') converter = tf.lite.TFLiteConverter.from_keras_model(model) tflite_model = converter.convert() open("converted_model.tflite", "wb").write(tflite_model)