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

Function _export_graph

tensorflow/contrib/learn/python/learn/utils/export.py:69–88  ·  view source on GitHub ↗

Exports graph via session_bundle, by creating a Session.

(graph, saver, checkpoint_path, export_dir,
                  default_graph_signature, named_graph_signatures,
                  exports_to_keep)

Source from the content-addressed store, hash-verified

67
68@deprecated('2017-03-25', 'Please use Estimator.export_savedmodel() instead.')
69def _export_graph(graph, saver, checkpoint_path, export_dir,
70 default_graph_signature, named_graph_signatures,
71 exports_to_keep):
72 """Exports graph via session_bundle, by creating a Session."""
73 with graph.as_default():
74 with tf_session.Session('') as session:
75 variables.local_variables_initializer()
76 lookup_ops.tables_initializer()
77 saver.restore(session, checkpoint_path)
78
79 export = exporter.Exporter(saver)
80 export.init(
81 init_op=control_flow_ops.group(
82 variables.local_variables_initializer(),
83 lookup_ops.tables_initializer()),
84 default_graph_signature=default_graph_signature,
85 named_graph_signatures=named_graph_signatures,
86 assets_collection=ops.get_collection(ops.GraphKeys.ASSET_FILEPATHS))
87 return export.export(export_dir, training_util.get_global_step(),
88 session, exports_to_keep=exports_to_keep)
89
90
91@deprecated('2017-03-25',

Callers 1

_export_estimatorFunction · 0.85

Calls 8

initMethod · 0.95
exportMethod · 0.95
ExporterMethod · 0.80
as_defaultMethod · 0.45
SessionMethod · 0.45
restoreMethod · 0.45
groupMethod · 0.45
get_collectionMethod · 0.45

Tested by

no test coverage detected