Better Programming

Advice for programmers.

Follow publication

Member-only story

How To Deploy Your TensorFlow Model in a Production Environment

Use TensorFlow Serving, Python, Traefik, FastAPI, and Docker to create a stable prediction engine

Patrick Kalkman
Better Programming
Published in
10 min readMar 5, 2021

--

Photo by Christina Morillo from Pexels.

If you have been following along, you know that I have been busy building a deep learning model. With this model, a cassava farmer can detect diseases on their crop. The farmer takes a picture of the cassava plant that they suspect has a condition. The application then shows the type of disease so that the farmer can take the appropriate measures.

To get an application on a farmer’s phone, we have to convert this TensorFlow model to an actual application. I am going to divide the application into four different services. These services are going to run in Docker containers. The reason for choosing Docker should be clear: Docker containers are the standard unit of deployment for any server-based application.

I will explain the rationale behind the four services and how they interact in this article. The picture below shows the final architecture:

The architecture of the solution
The architecture of the solution. Photo by the author.

The source code and Dockerfile of each service are available on GitHub. At the end of the…

--

--

Patrick Kalkman
Patrick Kalkman

Written by Patrick Kalkman

IT Architect, Developer & Writer focused on open-source, AI, LLMs & AI agents. Embracing agile methodologies, lifelong learning, and knowledge sharing.

Responses (1)

Write a response