diff options
author | Shanqing Cai <cais@google.com> | 2017-01-08 18:05:56 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2017-01-08 18:26:09 -0800 |
commit | bbdf8811ce81166b3e46c05ceddaa255bf869ef6 (patch) | |
tree | 77aceea44eda407ee4006d38e38d15d90b6cf89d | |
parent | 294a17ee2e051bd20af727a49e3a6be45be61f64 (diff) |
Automated rollback of change 143912820
Change: 143917962
-rw-r--r-- | tensorflow/contrib/learn/python/learn/learn_runner.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tensorflow/contrib/learn/python/learn/learn_runner.py b/tensorflow/contrib/learn/python/learn/learn_runner.py index f6b8f6151e..5b0000afc7 100644 --- a/tensorflow/contrib/learn/python/learn/learn_runner.py +++ b/tensorflow/contrib/learn/python/learn/learn_runner.py @@ -88,20 +88,20 @@ def run(experiment_fn, output_dir, schedule=None): # Execute the schedule if not hasattr(experiment, schedule): logging.error('Schedule references non-existent task %s', schedule) - valid_tasks = [x for x in dir(experiment) - if callable(getattr(experiment, x)) - and not x.startswith('_')] + valid_tasks = [x for x in experiment.__dict__ + if callable(getattr(experiment, x))] logging.error('Allowed values for this experiment are: %s', valid_tasks) - raise ValueError('Schedule references non-existent task %s' % schedule) + raise ValueError('Schedule references non-existent task %s', schedule) task = getattr(experiment, schedule) if not callable(task): logging.error('Schedule references non-callable member %s', schedule) - valid_tasks = [x for x in dir(experiment) - if callable(getattr(experiment, x)) - and not x.startswith('_')] + valid_tasks = [ + x for x in experiment.__dict__ + if callable(getattr(experiment, x)) and not x.startswith('_') + ] logging.error('Allowed values for this experiment are: %s', valid_tasks) - raise TypeError('Schedule references non-callable member %s' % schedule) + raise TypeError('Schedule references non-callable member %s', schedule) return task() |