mirror of
https://github.com/wassname/ray.git
synced 2026-06-28 03:02:56 +08:00
[tune] Fix directory naming regression (#6839)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import os
|
||||
import sys
|
||||
import unittest
|
||||
|
||||
@@ -57,7 +58,7 @@ class TrialRunnerTest(unittest.TestCase):
|
||||
trial_generator.add_configurations({name: spec})
|
||||
for trial in trial_generator.next_trials():
|
||||
trial_executor.start_trial(trial)
|
||||
self.assertLessEqual(len(trial.logdir), 200)
|
||||
self.assertLessEqual(len(os.path.basename(trial.logdir)), 200)
|
||||
trial_executor.stop_trial(trial)
|
||||
|
||||
def testExtraResources(self):
|
||||
|
||||
@@ -47,6 +47,8 @@ class SerialTuneRelativeLocalDirTest(unittest.TestCase):
|
||||
_register_all()
|
||||
|
||||
def _get_trial_dir(self, absoulte_exp_dir):
|
||||
print("looking for", self.MockTrainable._name)
|
||||
print("in", os.listdir(absoulte_exp_dir))
|
||||
trial_dirname = next(
|
||||
(child_dir for child_dir in os.listdir(absoulte_exp_dir)
|
||||
if (os.path.isdir(os.path.join(absoulte_exp_dir, child_dir))
|
||||
|
||||
@@ -270,7 +270,8 @@ class Trial:
|
||||
"""Init logger."""
|
||||
if not self.result_logger:
|
||||
if not self.logdir:
|
||||
self.logdir = Trial.create_logdir(str(self), self.local_dir)
|
||||
self.logdir = Trial.create_logdir(
|
||||
str(self) + "_" + self.experiment_tag, self.local_dir)
|
||||
else:
|
||||
os.makedirs(self.logdir, exist_ok=True)
|
||||
|
||||
|
||||
@@ -362,7 +362,7 @@ def run_experiments(experiments,
|
||||
reuse_actors=False,
|
||||
trial_executor=None,
|
||||
raise_on_failed_trial=True,
|
||||
concurrent=False):
|
||||
concurrent=True):
|
||||
"""Runs and blocks until all trials finish.
|
||||
|
||||
Examples:
|
||||
|
||||
Reference in New Issue
Block a user