Given graph, a directory to write summaries to (output_dir), a checkpoint
to restore variables from, and a dict of Tensors to evaluate, run an eval
loop for max_steps steps, or until an exception (generally, an
end-of-input signal from a reader operation) is raised from running
eval_dict.
In each step of evaluation, all tensors in the eval_dict are evaluated, and
every log_every_steps steps, they are logged. At the very end of evaluation,
a summary is evaluated (finding the summary ops using Supervisor's logic)
and written to output_dir.
Args
graph
A Graph to train. It is expected that this graph is not in use
elsewhere.
output_dir
A string containing the directory to write a summary to.
checkpoint_path
A string containing the path to a checkpoint to restore.
Can be None if the graph doesn't require loading any variables.
eval_dict
A dict mapping string names to tensors to evaluate. It is
evaluated in every logging step. The result of the final evaluation is
returned. If update_op is None, then it's evaluated in every step. If
max_steps is None, this should depend on a reader that will raise an
end-of-input exception when the inputs are exhausted.
update_op
A Tensor which is run in every step.
global_step_tensor
A Variable containing the global step. If None,
one is extracted from the graph using the same logic as in Supervisor.
Used to place eval summaries on training curves.
supervisor_master
The master string to use when preparing the session.
log_every_steps
Integer. Output logs every log_every_steps evaluation
steps. The logs contain the eval_dict and timing information.
feed_fn
A function that is called every iteration to produce a feed_dict
passed to session.run calls. Optional.
max_steps
Integer. Evaluate eval_dict this many times.
Returns
A tuple (eval_results, global_step):
eval_results
A dict mapping string to numeric values (int, float)
that are the result of running eval_dict in the last step. None if no
eval steps were run.
[null,null,["Last updated 2020-10-01 UTC."],[],[],null,["# tf.contrib.learn.evaluate\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/graph_actions.py#L477-L628) |\n\nEvaluate a model loaded from a checkpoint. (deprecated) \n\n tf.contrib.learn.evaluate(\n graph, output_dir, checkpoint_path, eval_dict, update_op=None,\n global_step_tensor=None, supervisor_master='', log_every_steps=10, feed_fn=None,\n max_steps=None\n )\n\n| **Warning:** THIS FUNCTION IS DEPRECATED. It will be removed after 2017-02-15. Instructions for updating: graph_actions.py will be deleted. Use tf.train.\\* utilities instead. You can use learn/estimators/estimator.py as an example.\n\nGiven `graph`, a directory to write summaries to (`output_dir`), a checkpoint\nto restore variables from, and a `dict` of `Tensor`s to evaluate, run an eval\nloop for `max_steps` steps, or until an exception (generally, an\nend-of-input signal from a reader operation) is raised from running\n`eval_dict`.\n\nIn each step of evaluation, all tensors in the `eval_dict` are evaluated, and\nevery `log_every_steps` steps, they are logged. At the very end of evaluation,\na summary is evaluated (finding the summary ops using `Supervisor`'s logic)\nand written to `output_dir`.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|----------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `graph` | A `Graph` to train. It is expected that this graph is not in use elsewhere. |\n| `output_dir` | A string containing the directory to write a summary to. |\n| `checkpoint_path` | A string containing the path to a checkpoint to restore. Can be `None` if the graph doesn't require loading any variables. |\n| `eval_dict` | A `dict` mapping string names to tensors to evaluate. It is evaluated in every logging step. The result of the final evaluation is returned. If `update_op` is None, then it's evaluated in every step. If `max_steps` is `None`, this should depend on a reader that will raise an end-of-input exception when the inputs are exhausted. |\n| `update_op` | A `Tensor` which is run in every step. |\n| `global_step_tensor` | A `Variable` containing the global step. If `None`, one is extracted from the graph using the same logic as in `Supervisor`. Used to place eval summaries on training curves. |\n| `supervisor_master` | The master string to use when preparing the session. |\n| `log_every_steps` | Integer. Output logs every `log_every_steps` evaluation steps. The logs contain the `eval_dict` and timing information. |\n| `feed_fn` | A function that is called every iteration to produce a `feed_dict` passed to `session.run` calls. Optional. |\n| `max_steps` | Integer. Evaluate `eval_dict` this many times. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------|\n| A tuple `(eval_results, global_step)`: ||\n| `eval_results` | A `dict` mapping `string` to numeric values (`int`, `float`) that are the result of running eval_dict in the last step. `None` if no eval steps were run. |\n| `global_step` | The global step this evaluation corresponds to. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Raises ------ ||\n|--------------|---------------------------|\n| `ValueError` | if `output_dir` is empty. |\n\n\u003cbr /\u003e"]]