TF Model Conversion to TF Lite (Part 1)

Learn to convert TF models to TF Lite format suitable for mobile and edge devices.

In TF, we build DL models using either Keras or a low-level TF API. These models are big in size and can’t run on resource-constrained mobile and edge devices, but we can convert our TF models to a relatively compact format using TF Lite. Let‘s explore the ways to convert TF models to TF Lite models.

Supported models

TF Lite can convert input models in the following formats:

  • The SavedModel format: This is the recommended standard format to serialize (save to disk) TF models. It also holds the metadata along with the model architecture and trained weights. Therefore, we don’t require any model-building code to load and use a SavedModel.

  • Keras model: This is a lightweight format supported by the high-level Keras API. It’s an alternative to the SavedModel format. However, Keras model files might not be compatible with other DL frameworks or APIs.

  • Models from concrete functions: These are constructed using low-level TF APIs.

Get hands-on with 1400+ tech skills courses.