Member-only story

How to Train TensorFlow Lite Models Locally and Deploy with Firebase

Nate Lema
4 min readJul 14, 2024

--

Introduction

Deploying Tensorflow lite models via Firebase allows for the continuous delivery of the newest model to mobile applications. This approach allows for models to be downloaded in the background seamlessly without affecting application functionality. Users are also able to experience the latest model without having to upgrade the application via the Google Play Store, or Apple App Store. The approach demonstrated here covers local model training, although there are cloud provider options for model training.

Example code, to follow the article can be found here https://github.com/spotlessthoughful/tensorflow-lite-firebase-medium

Code And Model Saving

Creating Your Project

In this case, I am creating a python project in PyCharm, and utilizing a jupyter notebook. Feel free to use a standard python file. Create your model.ipynb(or .py).

Code Run-through

This example, we are utilizing the mnist dataset, this dataset contains images of hand written digits. We are doing a basic load, normalize, build, compile, train, evaluate process. This…

--

--

Nate Lema
Nate Lema

Written by Nate Lema

Ex. McKinsey, Tech enthusiast passionate about cloud solutions, mobile app development, AI, and machine learning. Exploring the edge of innovation.

No responses yet