ray.train.context.TrainContext.get_trial_dir#
- TrainContext.get_trial_dir() str [source]#
Log directory corresponding to the trial directory for a Tune session. If calling from a Train session, this will give the trial directory of its parent Tune session.
from ray import train, tune def train_func(config): print(train.get_context().get_trial_dir()) tuner = tune.Tuner(train_func) tuner.fit()
/Users/root/ray_results/train_func_2023-07-19_15-01-37/train_func_d620c_00000_0_2023-07-19_15-01-40
PublicAPI (beta): This API is in beta and may change before becoming stable.
Warning
DEPRECATED: This API is deprecated and may be removed in future Ray releases.
get_trial_dir
is deprecated because the concept of aTrial
will soon be removed in Ray Train.Ray Train will no longer assume that it’s running within a Ray TuneTrial
in the future. See this issue for more context and migration options: ray-project/ray#49454