Book Image

Learn TensorFlow Enterprise

By : KC Tung
Book Image

Learn TensorFlow Enterprise

By: KC Tung

Overview of this book

TensorFlow as a machine learning (ML) library has matured into a production-ready ecosystem. This beginner’s book uses practical examples to enable you to build and deploy TensorFlow models using optimal settings that ensure long-term support without having to worry about library deprecation or being left behind when it comes to bug fixes or workarounds. The book begins by showing you how to refine your TensorFlow project and set it up for enterprise-level deployment. You’ll then learn how to choose a future-proof version of TensorFlow. As you advance, you’ll find out how to build and deploy models in a robust and stable environment by following recommended practices made available in TensorFlow Enterprise. This book also teaches you how to manage your services better and enhance the performance and reliability of your artificial intelligence (AI) applications. You’ll discover how to use various enterprise-ready services to accelerate your ML and AI workflows on Google Cloud Platform (GCP). Finally, you’ll scale your ML models and handle heavy workloads across CPUs, GPUs, and Cloud TPUs. By the end of this TensorFlow book, you’ll have learned the patterns needed for TensorFlow Enterprise model development, data pipelines, training, and deployment.
Table of Contents (15 chapters)
1
Section 1 – TensorFlow Enterprise Services and Features
4
Section 2 – Data Preprocessing and Modeling
7
Section 3 – Scaling and Tuning ML Works
10
Section 4 – Model Optimization and Deployment

Downloading TensorFlow Serving Docker images

Once the Docker engine is up and running, you are ready to perform the following steps:

  1. You may pull the latest TFS Docker image with this Docker command:
    docker pull tensorflow/serving
  2. This is now our base image. In order to add our model on top of this image, we need to run this base image first:
    docker run -d --name serv_base_img tensorflow/serving

In the preceding command, we invoked the tensorflow/serving image and now it is running as a Docker container. We also name this container serv_base_img.

Creating a new image with the model and serving it

Let's now take a look at the file directory here. For this example, the directory structure is as shown in the following figure:

Figure 9.2 – Directory structure for creating a custom Docker container

We will execute the following commands from the same directory as Tensorflow_Serving.ipynb.

After we have the TFS base Docker...