Three main steps
-
Conversion from Keras .h5 file to tensorflow .pb file; courtesy of here
Use following command : python3 keras_to_tensorflow.py -input_model_file <name of the .h5 file> -
Conversion to tensorflow .tflite file; courtesy of (here)
Use following command : toco --input_file=<path to generated .pb file>
--input_format=TENSORFLOW_GRAPHDEF
--output_format=TFLITE
--output_file=
--inference_type=FLOAT
--input_type=FLOAT
--input_arrays=<name of your input layer (according to tensorflow naming)> \
--output_arrays=<name of your output layer (according to tensorflow naming)>
--input_shapes=1,224,224,3 -
Inference on mobile; courtesy of here