diff options
-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() |