Exports graph via session_bundle, by creating a Session.
(graph, saver, checkpoint_path, export_dir,
default_graph_signature, named_graph_signatures,
exports_to_keep)
| 67 | |
| 68 | @deprecated('2017-03-25', 'Please use Estimator.export_savedmodel() instead.') |
| 69 | def _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', |
no test coverage detected