aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/python/estimator/training.py
diff options
context:
space:
mode:
authorGravatar Jianwei Xie <xiejw@google.com>2018-05-02 15:36:54 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-05-02 16:48:55 -0700
commit0237e86297087ba3e700ac9218f846e6e662c60f (patch)
tree4f17fe77d0fd8be7a0421a25cf9bd96bcb3d0efb /tensorflow/python/estimator/training.py
parent85566b2420833a4ba59241330eeceedea4f98e3c (diff)
Adds the EvalListener support for run_local.
PiperOrigin-RevId: 195163507
Diffstat (limited to 'tensorflow/python/estimator/training.py')
-rw-r--r--tensorflow/python/estimator/training.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tensorflow/python/estimator/training.py b/tensorflow/python/estimator/training.py
index 534c357067..41ffa371aa 100644
--- a/tensorflow/python/estimator/training.py
+++ b/tensorflow/python/estimator/training.py
@@ -656,6 +656,11 @@ class _TrainingExecutor(object):
max_steps=self._train_spec.max_steps,
hooks=train_hooks)
+ if not self._continuous_eval_listener.before_eval():
+ logging.info('Exiting training and evaluation lopp, as requested by '
+ '_ContinuousEvalListener.before_eval.')
+ break
+
# Final export signal: For any eval result with global_step >= train
# max_steps, the evaluator will send the final export signal. The
# _should_stop_local_train will then end the while True as the stopping
@@ -669,6 +674,11 @@ class _TrainingExecutor(object):
raise RuntimeError('There was no new checkpoint after the training. '
'Eval status: {}'.format(eval_result.status))
+ if not self._continuous_eval_listener.after_eval(eval_result):
+ logging.info('Exiting evaluation, as requested by '
+ '_ContinuousEvalListener.after_eval.')
+ break
+
if _should_stop_local_train(
eval_result.metrics[ops.GraphKeys.GLOBAL_STEP]):
break