Machine Learning Notes - Model Deployment Based on TensorFlow Lite

1. Brief introduction

         TensorFlow Lite is a mobile library that can be used to deploy models on mobile devices, microcontrollers, and other edge devices.

         Suppose you want to perform an image classification task. First decide on the model of the task. Is to create a custom model; or use a pre-trained model, such as InceptionNet, MobileNet, NASNetLarge, etc. Or apply transfer learning on pre-trained models.

        After the model training is complete, you will convert the model to the Tensorflow Lite version. The TF lite model is a special format model that is efficient in terms of accuracy and a lightweight version with a smaller footprint, these characteristics make the TF Lite model very suitable for working on mobile and embedded devices.

TensorFlow Lite conversion process

2. Model conversion

        Convert keras format

#Save the keras model after compiling
model.save('model_keras.h5')
model_keras= tf.keras.models.load_model('model_keras.h5')
# Converting a tf.Ker

Guess you like

Origin blog.csdn.net/bashendixie5/article/details/130943178