Do not export from eval on train data steps.

PiperOrigin-RevId: 168374021
This commit is contained in:
A. Unique TensorFlower 2017-09-12 07:36:24 -07:00 committed by TensorFlower Gardener
parent 9b9e54b344
commit f7ba16fdf3

View File

@ -410,7 +410,8 @@ class Experiment(object):
delay_secs, delay_secs,
throttle_delay_secs, throttle_delay_secs,
evaluate_checkpoint_only_once=True, evaluate_checkpoint_only_once=True,
continuous_eval_predicate_fn=None): continuous_eval_predicate_fn=None,
export=True):
"""Run continuous eval. """Run continuous eval.
Runs infinite eval on the evaluation data set. This function starts Runs infinite eval on the evaluation data set. This function starts
@ -436,6 +437,7 @@ class Experiment(object):
handles that gracefully. When `predicate_fn` is not specified, handles that gracefully. When `predicate_fn` is not specified,
continuous eval will run in an infinite loop (if `train_steps` is None) continuous eval will run in an infinite loop (if `train_steps` is None)
or exit once global step reaches `train_steps`. or exit once global step reaches `train_steps`.
export: Whether to export from this step. Default is 'True'.
Raises: Raises:
ValueError: if `continuous_eval_predicate_fn` is neither None nor ValueError: if `continuous_eval_predicate_fn` is neither None nor
@ -495,7 +497,8 @@ class Experiment(object):
if not eval_result: if not eval_result:
eval_result = {} eval_result = {}
self._maybe_export(eval_result, checkpoint_path=latest_path) if export:
self._maybe_export(eval_result, checkpoint_path=latest_path)
# Clear warning timer and update last evaluated checkpoint # Clear warning timer and update last evaluated checkpoint
last_warning_time = 0 last_warning_time = 0
@ -541,7 +544,8 @@ class Experiment(object):
name=name, name=name,
delay_secs=delay_secs, delay_secs=delay_secs,
throttle_delay_secs=throttle_delay_secs, throttle_delay_secs=throttle_delay_secs,
continuous_eval_predicate_fn=continuous_eval_predicate_fn) continuous_eval_predicate_fn=continuous_eval_predicate_fn,
export=False)
def train_and_evaluate(self): def train_and_evaluate(self):
"""Interleaves training and evaluation. """Interleaves training and evaluation.