mirror of
https://github.com/wassname/ray.git
synced 2026-07-18 12:40:56 +08:00
[tune] Fixup exception messages (#5238)
This commit is contained in:
@@ -26,6 +26,8 @@ from ray.tune.util import UtilMonitor
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
SETUP_TIME_THRESHOLD = 10
|
||||
|
||||
|
||||
class Trainable(object):
|
||||
"""Abstract class for trainable models, functions, etc.
|
||||
@@ -93,7 +95,14 @@ class Trainable(object):
|
||||
self._timesteps_since_restore = 0
|
||||
self._iterations_since_restore = 0
|
||||
self._restored = False
|
||||
start_time = time.time()
|
||||
self._setup(copy.deepcopy(self.config))
|
||||
setup_time = time.time() - start_time
|
||||
if setup_time > SETUP_TIME_THRESHOLD:
|
||||
logger.info("_setup took {:.3f} seconds. If your trainable is "
|
||||
"slow to initialize, consider setting "
|
||||
"reuse_actors=True to reduce actor creation "
|
||||
"overheads.".format(setup_time))
|
||||
self._local_ip = ray.services.get_node_ip_address()
|
||||
self._monitor = UtilMonitor(start=log_sys_usage)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user