Using Python, it is straightforward to load the computational graphs stored inside a SavedModel and use them as native Python functions. This is all thanks to the TensorFlow Python API. The tf.saved_model.load(path) method deserializes the SavedModel located in path and returns a trackable object with a signatures attribute that contains the mapping from the signature keys to Python functions that are ready to be used.
The load method is capable of deserializing the following:
- Generic computational graphs, such as the ones we created in the previous section
- Keras models
- SavedModel created using TensorFlow 1.x or the Estimator API