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

Method export_meta_graph

tensorflow/python/training/saver.py:1472–1516  ·  view source on GitHub ↗

Writes `MetaGraphDef` to save_path/filename. Args: filename: Optional meta_graph filename including the path. collection_list: List of string keys to collect. as_text: If `True`, writes the meta_graph as an ASCII proto. export_scope: Optional `string`. Name scope to remo

(self,
                        filename=None,
                        collection_list=None,
                        as_text=False,
                        export_scope=None,
                        clear_devices=False,
                        clear_extraneous_savers=False,
                        strip_default_attrs=False,
                        save_debug_info=False)

Source from the content-addressed store, hash-verified

1470 return model_checkpoint_path
1471
1472 def export_meta_graph(self,
1473 filename=None,
1474 collection_list=None,
1475 as_text=False,
1476 export_scope=None,
1477 clear_devices=False,
1478 clear_extraneous_savers=False,
1479 strip_default_attrs=False,
1480 save_debug_info=False):
1481 # pylint: disable=line-too-long
1482 """Writes `MetaGraphDef` to save_path/filename.
1483
1484 Args:
1485 filename: Optional meta_graph filename including the path.
1486 collection_list: List of string keys to collect.
1487 as_text: If `True`, writes the meta_graph as an ASCII proto.
1488 export_scope: Optional `string`. Name scope to remove.
1489 clear_devices: Whether or not to clear the device field for an `Operation`
1490 or `Tensor` during export.
1491 clear_extraneous_savers: Remove any Saver-related information from the
1492 graph (both Save/Restore ops and SaverDefs) that are not associated with
1493 this Saver.
1494 strip_default_attrs: Boolean. If `True`, default-valued attributes will be
1495 removed from the NodeDefs. For a detailed guide, see
1496 [Stripping Default-Valued
1497 Attributes](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/saved_model/README.md#stripping-default-valued-attributes).
1498 save_debug_info: If `True`, save the GraphDebugInfo to a separate file,
1499 which in the same directory of filename and with `_debug` added before
1500 the file extension.
1501
1502 Returns:
1503 A `MetaGraphDef` proto.
1504 """
1505 # pylint: enable=line-too-long
1506 return export_meta_graph(
1507 filename=filename,
1508 graph_def=ops.get_default_graph().as_graph_def(add_shapes=True),
1509 saver_def=self.saver_def,
1510 collection_list=collection_list,
1511 as_text=as_text,
1512 export_scope=export_scope,
1513 clear_devices=clear_devices,
1514 clear_extraneous_savers=clear_extraneous_savers,
1515 strip_default_attrs=strip_default_attrs,
1516 save_debug_info=save_debug_info)
1517
1518 def restore(self, sess, save_path):
1519 """Restores previously saved variables.

Callers 15

doBasicsOneExportPathMethod · 0.95
_testBasicsMethod · 0.95
saveMethod · 0.95
testAddCollectionDefMethod · 0.95
testSliceVariableMethod · 0.95
_testGradientSerDesMethod · 0.95
testStrippedOpListDefMethod · 0.95
setUpMethod · 0.45

Calls 2

export_meta_graphFunction · 0.85
as_graph_defMethod · 0.80

Tested by 15

doBasicsOneExportPathMethod · 0.76
_testBasicsMethod · 0.76
testAddCollectionDefMethod · 0.76
testSliceVariableMethod · 0.76
_testGradientSerDesMethod · 0.76
testStrippedOpListDefMethod · 0.76
setUpMethod · 0.36
_CopyGraphMethod · 0.36