May 2020
Beginner to intermediate
430 pages
10h 39m
English
The Python API makes it easy for us to use the TensorFlow Lite converter. In this section, we will describe the Python API that uses the tflite converter. For more information, please refer to the following link: https://www.tensorflow.org/lite/convert/python_api.
Three methods are suggested, depending on the type of converter you have – a saved model, a Keras model, or concrete functions. The following code shows how to call tf.lite.TFLiteConverter from the Python API to convert each of the three models (saved model, Keras model, or concrete functions):
$import tensorflow as tf$converter = tf.lite.TFLiteConverter.from_saved_model(export_dir)$converter = tf.lite.TFLiteConverter.from_keras_model(model)$converter = tf.lite.TFLiteConverter.from_concrete_functions([concrete_func]) ...