mirror of
https://github.com/wassname/ray.git
synced 2026-08-10 12:30:14 +08:00
[tune] Tune onto Logging Module (#2882)
Moves Tune onto logging in Python. Ignores examples and tests.
This commit is contained in:
@@ -3,6 +3,7 @@ from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
import copy
|
||||
import logging
|
||||
import six
|
||||
import types
|
||||
|
||||
@@ -10,6 +11,8 @@ from ray.tune.result import DEFAULT_RESULTS_DIR
|
||||
from ray.tune.error import TuneError
|
||||
from ray.tune.registry import register_trainable
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class Experiment(object):
|
||||
"""Tracks experiment specifications.
|
||||
@@ -158,7 +161,8 @@ class Experiment(object):
|
||||
return run_object
|
||||
elif isinstance(run_object, types.FunctionType):
|
||||
if run_object.__name__ == "<lambda>":
|
||||
print("Not auto-registering lambdas - resolving as variant.")
|
||||
logger.warning(
|
||||
"Not auto-registering lambdas - resolving as variant.")
|
||||
return run_object
|
||||
else:
|
||||
name = run_object.__name__
|
||||
@@ -202,8 +206,8 @@ def convert_to_experiment_list(experiments):
|
||||
if (type(exp_list) is list
|
||||
and all(isinstance(exp, Experiment) for exp in exp_list)):
|
||||
if len(exp_list) > 1:
|
||||
print("Warning: All experiments will be"
|
||||
" using the same Search Algorithm.")
|
||||
logger.warning("All experiments will be "
|
||||
"using the same SearchAlgorithm.")
|
||||
else:
|
||||
raise TuneError("Invalid argument: {}".format(experiments))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user