Converting TensorFlow model to TensorFlow Lite

Now that we have trained the model in the usual way, let's look at how we can convert this model into a TensorFlow Lite format.

The general procedure for conversion is illustrated in the following diagram:

The procedure is simple: we take a trained model, freeze the graph, optimize it for inference/prediction, and convert it into .tflite format. Before going further, let's understand what we mean by Freeze Graph and Optimize For Inference:

  • Freeze Graph : Freeze graph operation effectively freezes the weights of the model by converting all the of the TF Variables as Constants. As you can imagine, ...

Get TensorFlow Machine Learning Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.