diff options
author | A. Unique TensorFlower <gardener@tensorflow.org> | 2017-03-30 09:16:07 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2017-03-30 10:31:01 -0700 |
commit | d94d6df221e48ea3a2a077571f6ae0c0fec790e7 (patch) | |
tree | b3d3c3f5ba05998b5574de83627f578dbb7d995e | |
parent | 1ba53b9057003995470527052791e656677698cb (diff) |
Add support for `init_fn` in `evaluation_loop`.
Change: 151716031
-rw-r--r-- | tensorflow/contrib/slim/python/slim/evaluation.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tensorflow/contrib/slim/python/slim/evaluation.py b/tensorflow/contrib/slim/python/slim/evaluation.py index ff6e408225..85616be410 100644 --- a/tensorflow/contrib/slim/python/slim/evaluation.py +++ b/tensorflow/contrib/slim/python/slim/evaluation.py @@ -213,6 +213,7 @@ def evaluation_loop(master, num_evals=1, initial_op=None, initial_op_feed_dict=None, + init_fn=None, eval_op=None, eval_op_feed_dict=None, final_op=None, @@ -233,6 +234,8 @@ def evaluation_loop(master, num_evals: The number of times to run `eval_op`. initial_op: An operation run at the beginning of evaluation. initial_op_feed_dict: A feed dictionary to use when executing `initial_op`. + init_fn: An optional callable to be executed after `init_op` is called. The + callable must accept one argument, the session being initialized. eval_op: A operation run `num_evals` times. eval_op_feed_dict: The feed dictionary to use when executing the `eval_op`. final_op: An operation to execute after all of the `eval_op` executions. The @@ -273,7 +276,8 @@ def evaluation_loop(master, checkpoint_dir, master=master, scaffold=monitored_session.Scaffold( - init_op=initial_op, init_feed_dict=initial_op_feed_dict, saver=saver), + init_op=initial_op, init_feed_dict=initial_op_feed_dict, + init_fn=init_fn, saver=saver), eval_ops=eval_op, feed_dict=eval_op_feed_dict, final_ops=final_op, |