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

Function export_meta_graph

tensorflow/python/training/saver.py:1771–1854  ·  view source on GitHub ↗

Returns `MetaGraphDef` proto. Optionally writes it to filename. This function exports the graph, saver, and collection objects into `MetaGraphDef` protocol buffer with the intention of it being imported at a later time or location to restart training, run inference, or be a subgraph.

(filename=None,
                      meta_info_def=None,
                      graph_def=None,
                      saver_def=None,
                      collection_list=None,
                      as_text=False,
                      graph=None,
                      export_scope=None,
                      clear_devices=False,
                      clear_extraneous_savers=False,
                      strip_default_attrs=False,
                      save_debug_info=False,
                      incr_saver_def=None,
                      **kwargs)

Source from the content-addressed store, hash-verified

1769
1770@tf_export(v1=["train.export_meta_graph"])
1771def export_meta_graph(filename=None,
1772 meta_info_def=None,
1773 graph_def=None,
1774 saver_def=None,
1775 collection_list=None,
1776 as_text=False,
1777 graph=None,
1778 export_scope=None,
1779 clear_devices=False,
1780 clear_extraneous_savers=False,
1781 strip_default_attrs=False,
1782 save_debug_info=False,
1783 incr_saver_def=None,
1784 **kwargs):
1785 # pylint: disable=line-too-long
1786 """Returns `MetaGraphDef` proto.
1787
1788 Optionally writes it to filename.
1789
1790 This function exports the graph, saver, and collection objects into
1791 `MetaGraphDef` protocol buffer with the intention of it being imported
1792 at a later time or location to restart training, run inference, or be
1793 a subgraph.
1794
1795 Args:
1796 filename: Optional filename including the path for writing the generated
1797 `MetaGraphDef` protocol buffer.
1798 meta_info_def: `MetaInfoDef` protocol buffer.
1799 graph_def: `GraphDef` protocol buffer.
1800 saver_def: `SaverDef` protocol buffer.
1801 collection_list: List of string keys to collect.
1802 as_text: If `True`, writes the `MetaGraphDef` as an ASCII proto.
1803 graph: The `Graph` to export. If `None`, use the default graph.
1804 export_scope: Optional `string`. Name scope under which to extract the
1805 subgraph. The scope name will be striped from the node definitions for
1806 easy import later into new name scopes. If `None`, the whole graph is
1807 exported. graph_def and export_scope cannot both be specified.
1808 clear_devices: Whether or not to clear the device field for an `Operation`
1809 or `Tensor` during export.
1810 clear_extraneous_savers: Remove any Saver-related information from the graph
1811 (both Save/Restore ops and SaverDefs) that are not associated with the
1812 provided SaverDef.
1813 strip_default_attrs: Boolean. If `True`, default-valued attributes will be
1814 removed from the NodeDefs. For a detailed guide, see
1815 [Stripping Default-Valued Attributes](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/saved_model/README.md#stripping-default-valued-attributes).
1816 save_debug_info: If `True`, save the GraphDebugInfo to a separate file,
1817 which in the same directory of filename and with `_debug` added before the
1818 file extend.
1819 **kwargs: Optional keyed arguments.
1820
1821 Returns:
1822 A `MetaGraphDef` proto.
1823
1824 Raises:
1825 ValueError: When the `GraphDef` is larger than 2GB.
1826 RuntimeError: If called with eager execution enabled.
1827
1828 @compatibility(eager)

Callers 3

_inline_functionsMethod · 0.90
export_meta_graphMethod · 0.85

Calls 1

executing_eagerlyMethod · 0.80

Tested by 1

_inline_functionsMethod · 0.72