|  View source on GitHub | 
Returns MetaGraphDef proto.
tf.compat.v1.train.export_meta_graph(
    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,
    **kwargs
)
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.
| Args | |
|---|---|
| filename | Optional filename including the path for writing the generated MetaGraphDefprotocol buffer. | 
| meta_info_def | MetaInfoDefprotocol buffer. | 
| graph_def | GraphDefprotocol buffer. | 
| saver_def | SaverDefprotocol buffer. | 
| collection_list | List of string keys to collect. | 
| as_text | If True, writes theMetaGraphDefas an ASCII proto. | 
| graph | The Graphto export. IfNone, use the default graph. | 
| export_scope | Optional string. Name scope under which to extract the
subgraph. The scope name will be striped from the node definitions for
easy import later into new name scopes. IfNone, the whole graph is
exported. graph_def and export_scope cannot both be specified. | 
| clear_devices | Whether or not to clear the device field for an OperationorTensorduring export. | 
| clear_extraneous_savers | Remove any Saver-related information from the graph (both Save/Restore ops and SaverDefs) that are not associated with the provided SaverDef. | 
| strip_default_attrs | Boolean. If True, default-valued attributes will be
removed from the NodeDefs. For a detailed guide, see Stripping
Default-Valued
Attributes. | 
| save_debug_info | If True, save the GraphDebugInfo to a separate file,
which in the same directory of filename and with_debugadded before the
file extend. | 
| **kwargs | Optional keyed arguments. | 
| Returns | |
|---|---|
| A MetaGraphDefproto. | 
| Raises | |
|---|---|
| ValueError | When the GraphDefis larger than 2GB. | 
| RuntimeError | If called with eager execution enabled. | 
eager compatibility
Exporting/importing meta graphs is not supported unless both graph_def and
graph are provided. No graph exists when eager execution is enabled.