W3cubDocs

/TensorFlow Python

tf.saved_model.loader.load(sess, tags, export_dir, **saver_kwargs)

tf.saved_model.loader.load(sess, tags, export_dir, **saver_kwargs)

Loads the model from a SavedModel as specified by tags.

Args:

  • sess: The TensorFlow session to restore the variables.
  • tags: Set of string tags to identify the required MetaGraphDef. These should correspond to the tags used when saving the variables using the SavedModel save() API.
  • export_dir: Directory in which the SavedModel protocol buffer and variables to be loaded are located. **saver_kwargs: Optional keyword arguments passed through to Saver.

Returns:

The MetaGraphDef protocol buffer loaded in the provided session. This can be used to further extract signature-defs, collection-defs, etc.

Raises:

  • RuntimeError: MetaGraphDef associated with the tags cannot be found.

Defined in tensorflow/python/saved_model/loader_impl.py.

© 2017 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/saved_model/loader/load