TensorFlow 2.0 Beta is available Learn more

Converter command line reference

This page describes how to use the TensorFlow Lite converter using the command line tool in TensorFlow 2.0. The preferred approach for conversion is using the Python API.

High-level overview

The TensorFlow Lite Converter has a command line tool tflite_convert which supports basic models. Use the TFLiteConverter Python API for any conversions involving quantization or any additional parameters (e.g. signatures in SavedModels or custom objects in Keras models).


The following flags specify the input and output files.

  • --output_file. Type: string. Specifies the full path of the output file.
  • --saved_model_dir. Type: string. Specifies the full path to the directory containing the SavedModel generated in 1.X or 2.0.
  • --keras_model_file. Type: string. Specifies the full path of the HDF5 file containing the tf.keras model generated in 1.X or 2.0.

The following is an example usage.

tflite_convert \
  --saved_model_dir=/tmp/mobilenet_saved_model \

Additional instructions

Building from source

In order to run the latest version of the TensorFlow Lite Converter either install the nightly build using pip or clone the TensorFlow repository and use bazel. An example can be seen below.

bazel run //third_party/tensorflow/lite/python:tflite_convert -- \
  --saved_model_dir=/tmp/mobilenet_saved_model \