1

I have a model trained with TF 1.4 exported to a frozen inference graph with the file "models/research/object_detection/export_tflite_ssd_graph.py"

How can I can convert it tflite? I'm having a lot of issues

user8920367
  • 95
  • 1
  • 5
  • Does this answer your question? [Tensorflow Convert pb file to TFLITE using python](https://stackoverflow.com/questions/50632152/tensorflow-convert-pb-file-to-tflite-using-python) – Martin Brisiak Aug 02 '20 at 13:27

1 Answers1

2

You can use the command line tool or the Python API.

Python API example:

converter = tf.lite.TFLiteConverter.from_frozen_graph(
  graph_def_file, input_arrays, output_arrays)
tflite_model = converter.convert()
open("converted_model.tflite", "wb").write(tflite_model)

CLI example:

tflite_convert \
  --output_file=/tmp/foo.tflite \
  --graph_def_file=/tmp/mobilenet_v1_0.50_128/frozen_graph.pb \
  --input_arrays=input \
  --output_arrays=MobilenetV1/Predictions/Reshape_1

Tensorflow officially recommends using the Python API.

sakumoil
  • 602
  • 4
  • 11