tf.contrib.learn.ExportStrategy
Stay organized with collections
Save and categorize content based on your preferences.
A class representing a type of model export.
tf.contrib.learn.ExportStrategy(
name, export_fn, strip_default_attrs=None
)
THIS CLASS IS DEPRECATED. See
contrib/learn/README.md
for general migration instructions.
Typically constructed by a utility function specific to the exporter, such as
saved_model_export_utils.make_export_strategy()
.
Attributes |
name
|
The directory name under the export base directory where exports of
this type will be written.
|
export_fn
|
A function that writes an export, given an estimator, a
destination path, and optionally a checkpoint path and an evaluation
result for that checkpoint. This export_fn() may be run repeatedly during
continuous training, or just once at the end of fixed-length training.
Note the export_fn() may choose whether or not to export based on the eval
result or based on an internal timer or any other criterion, if exports
are not desired for every checkpoint.
The signature of this function must be one of:
(estimator, export_path) -> export_path
(estimator, export_path, checkpoint_path) -> export_path
(estimator, export_path, checkpoint_path, eval_result) -> export_path
(estimator, export_path, checkpoint_path, eval_result,
strip_default_attrs) -> export_path
|
strip_default_attrs
|
(Optional) Boolean. If set as True, default attrs in
the GraphDef will be stripped on write. This is recommended for better
forward compatibility of the resulting SavedModel .
|
Methods
export
View source
export(
estimator, export_path, checkpoint_path=None, eval_result=None
)
Exports the given Estimator to a specific format.
Args |
estimator
|
the Estimator to export.
|
export_path
|
A string containing a directory where to write the export.
|
checkpoint_path
|
The checkpoint path to export. If None (the default),
the strategy may locate a checkpoint (e.g. the most recent) by itself.
|
eval_result
|
The output of Estimator.evaluate on this checkpoint. This
should be set only if checkpoint_path is provided (otherwise it is
unclear which checkpoint this eval refers to).
|
Returns |
The string path to the exported directory.
|
Raises |
ValueError
|
if the export_fn does not have the required signature
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-10-01 UTC.
[null,null,["Last updated 2020-10-01 UTC."],[],[],null,["# tf.contrib.learn.ExportStrategy\n\n\u003cbr /\u003e\n\n|--------------------------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/contrib/learn/python/learn/export_strategy.py#L34-L110) |\n\nA class representing a type of model export. \n\n tf.contrib.learn.ExportStrategy(\n name, export_fn, strip_default_attrs=None\n )\n\nTHIS CLASS IS DEPRECATED. See\n[contrib/learn/README.md](https://www.tensorflow.org/code/tensorflow/contrib/learn/README.md)\nfor general migration instructions.\n\nTypically constructed by a utility function specific to the exporter, such as\n`saved_model_export_utils.make_export_strategy()`.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Attributes ---------- ||\n|-----------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `name` | The directory name under the export base directory where exports of this type will be written. |\n| `export_fn` | A function that writes an export, given an estimator, a destination path, and optionally a checkpoint path and an evaluation result for that checkpoint. This export_fn() may be run repeatedly during continuous training, or just once at the end of fixed-length training. Note the export_fn() may choose whether or not to export based on the eval result or based on an internal timer or any other criterion, if exports are not desired for every checkpoint. \u003cbr /\u003e The signature of this function must be one of: - `(estimator, export_path) -\u003e export_path` - `(estimator, export_path, checkpoint_path) -\u003e export_path` - `(estimator, export_path, checkpoint_path, eval_result) -\u003e export_path` - `(estimator, export_path, checkpoint_path, eval_result, strip_default_attrs) -\u003e export_path` |\n| `strip_default_attrs` | (Optional) Boolean. If set as True, default attrs in the `GraphDef` will be stripped on write. This is recommended for better forward compatibility of the resulting `SavedModel`. |\n\nMethods\n-------\n\n### `export`\n\n[View source](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/contrib/learn/python/learn/export_strategy.py#L75-L110) \n\n export(\n estimator, export_path, checkpoint_path=None, eval_result=None\n )\n\nExports the given Estimator to a specific format.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ||\n|-------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `estimator` | the Estimator to export. |\n| `export_path` | A string containing a directory where to write the export. |\n| `checkpoint_path` | The checkpoint path to export. If None (the default), the strategy may locate a checkpoint (e.g. the most recent) by itself. |\n| `eval_result` | The output of Estimator.evaluate on this checkpoint. This should be set only if checkpoint_path is provided (otherwise it is unclear which checkpoint this eval refers to). |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|---|---|\n| The string path to the exported directory. ||\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Raises ||\n|--------------|-------------------------------------------------------|\n| `ValueError` | if the export_fn does not have the required signature |\n\n\u003cbr /\u003e"]]