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

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 source code and Dockerfile of each service are available on GitHub. At the end of the…