Saving models for TF Serving

In order to serve the models, they need to be saved first. In this section, we demonstrate a slightly modified version of the MNIST example from the official TensorFlow documentation, available at the following link: https://www.tensorflow.org/serving/serving_basic.

The TensorFlow team recommends using SavedModel for saving and restoring models built and trained in TensorFlow. According to the TensorFlow documentation:

SavedModel is a language-neutral, recoverable, hermetic serialization format. SavedModel enables higher-level systems and tools to produce, consume, and transform TensorFlow models.
You can follow along with the code in the Jupyter notebook ch-11b_Saving_TF_Models_with_SavedModel_for_TF_Serving ...

Get Python: Advanced Guide to Artificial Intelligence now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.