aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/python/estimator/training.py
diff options
context:
space:
mode:
authorGravatar Jianwei Xie <xiejw@google.com>2017-10-04 12:41:45 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-10-04 12:46:07 -0700
commit943c6d7af7a8ccd4f824a2c0f90b251587c63fea (patch)
tree5a3ad83df0155e06708a7e141823423f218e0206 /tensorflow/python/estimator/training.py
parent8c9ef44668c767dd30de14f49fb96be6e2648243 (diff)
errors out if the evaluator has task id > 0.
PiperOrigin-RevId: 171047652
Diffstat (limited to 'tensorflow/python/estimator/training.py')
-rw-r--r--tensorflow/python/estimator/training.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/tensorflow/python/estimator/training.py b/tensorflow/python/estimator/training.py
index 166b7b20ed..953e970eea 100644
--- a/tensorflow/python/estimator/training.py
+++ b/tensorflow/python/estimator/training.py
@@ -438,14 +438,18 @@ def train_and_evaluate(estimator, train_spec, eval_spec):
'`estimator.config` must have task_type set. This usually means '
'TF_CONFIG environment is not set correctly.')
- # TODO(xiejw): error out if evaluator index is more than 0.
-
if config.task_type == 'local':
raise ValueError(
'`task.type` in TF_CONFIG cannot be `local`. Leaving `cluster` and '
'`task` properties in TF_CONFIG absent triggers train and evaluate '
'`Estimator` locally (non-distributed).')
+ if (config.task_type == run_config_lib.TaskType.EVALUATOR and
+ config.task_id > 0):
+ raise ValueError(
+ 'For distributed training, there can only be one `evaluator` task '
+ '(with task id 0). Given task id {}'.format(config.task_id))
+
# For task type foo, call executor.run_foo.
available_tasks = [x for x in dir(executor) if x.startswith('run_')
and x != 'run_local'