Check Mobile App
Read now
Start a Project

How to convert python model to TensorFlow Lite

Save

TensorFlow is a powerful tool that help us to integrate python in Mobile app. I already wrote a blog about the TensorFlow implementation in iOS. Click here to Visit blog.

In this blog, I will show how to convert a model to .tflite. We assume that you have already created a model in Python.You have the following two options for using the converter:

  1. Python API (recommended): This makes it easier to convert models as part of the model development pipeline, apply optimisations, add metadata and has many more features.
  2. Command line: This only supports basic model conversion.

Let start:

1. Using Python: Suppose we have model in directory  fruits.

Note: you can execute this code from local or colab.

2. Using C
ommand: To execute the cmd you have to install TensorFlow with pip in your system. Here is the step to install TenserFlow.

Now run below command.

Visit git reference to know about command.
Note: TensorFlow not recommended this because it only supports basic model conversion.

Conclusion:
How to convert python model to TensorFlow Lite

Using this code and command we can easily create MobileNet mode.

I hope this Blog will help you to create .tflite file. If you feel any doubt or query please comment below.

Visit my other blogs click here.

Thank you.

. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


2 comments

  • faiza
    i have converted the .pb file but it will not be converted to tflite… i have yolov3-tiny model.
  • css.php

    The support is fast and do everything in their power to make it perfect. If you need customization it's also done right away. I had massive research to select Mobikul and now I'm sure it was the right one.

    Igor Souza

    Igor Souza

    Talk to Sales

    Global

    Live Chat
    Start a Project

      Message Sent!

      If you have more details or questions, you can reply to the received confirmation email.

      Back to Home