MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / load

Method load

tensorflow/python/saved_model/loader_impl.py:405–425  ·  view source on GitHub ↗

Load the MetaGraphDef graph and restore variable values into the session. Args: sess: tf.compat.v1.Session to restore variable values. tags: a set of string tags identifying a MetaGraphDef. import_scope: Optional `string` -- if specified, prepend this string followed b

(self, sess, tags, import_scope=None, **saver_kwargs)

Source from the content-addressed store, hash-verified

403 sess.run(fetches=[init_op], feed_dict=asset_tensors_dictionary)
404
405 def load(self, sess, tags, import_scope=None, **saver_kwargs):
406 """Load the MetaGraphDef graph and restore variable values into the session.
407
408 Args:
409 sess: tf.compat.v1.Session to restore variable values.
410 tags: a set of string tags identifying a MetaGraphDef.
411 import_scope: Optional `string` -- if specified, prepend this string
412 followed by '/' to all loaded tensor names. This scope is applied to
413 tensor instances loaded into the passed session, but it is *not* written
414 through to the static `MetaGraphDef` protocol buffer that is returned.
415 **saver_kwargs: keyword arguments to pass to tf.train.import_meta_graph.
416
417 Returns:
418 `MetagraphDef` proto of the graph that was loaded.
419 """
420 with sess.graph.as_default():
421 saver, _ = self.load_graph(sess.graph, tags, import_scope,
422 **saver_kwargs)
423 self.restore_variables(sess, saver, import_scope)
424 self.run_init_ops(sess, tags, import_scope)
425 return self.get_meta_graph_def_from_tags(tags)

Callers 15

test_load_functionMethod · 0.95
loadFunction · 0.95
test_asset_loadingMethod · 0.45
test_condMethod · 0.45
test_whileMethod · 0.45

Calls 5

load_graphMethod · 0.95
restore_variablesMethod · 0.95
run_init_opsMethod · 0.95
as_defaultMethod · 0.45

Tested by 15

test_load_functionMethod · 0.76
test_asset_loadingMethod · 0.36
test_condMethod · 0.36
test_whileMethod · 0.36
test_nested_whileMethod · 0.36