Skip to Content
Mastering Computer Vision with TensorFlow 2.x
book

Mastering Computer Vision with TensorFlow 2.x

by Krishnendu Kar
May 2020
Beginner to intermediate
430 pages
10h 39m
English
Packt Publishing
Content preview from Mastering Computer Vision with TensorFlow 2.x

Python API

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]) ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hands-On Computer Vision with TensorFlow 2

Hands-On Computer Vision with TensorFlow 2

Benjamin Planche, Eliot Andres

Publisher Resources

ISBN: 9781838827069Supplemental Content