From 49ae4bae2600f1c7aaf13968fb0639650474ffb7 Mon Sep 17 00:00:00 2001 From: sbtc-sipbb Date: Tue, 23 Sep 2025 13:28:16 +0200 Subject: [PATCH] Fixes abs path for logdir when pbt is not used --- scripts/reinforcement_learning/rl_games/train.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/scripts/reinforcement_learning/rl_games/train.py b/scripts/reinforcement_learning/rl_games/train.py index 7f7346fc932..5b088d9ab3d 100644 --- a/scripts/reinforcement_learning/rl_games/train.py +++ b/scripts/reinforcement_learning/rl_games/train.py @@ -127,11 +127,10 @@ def main(env_cfg: ManagerBasedRLEnvCfg | DirectRLEnvCfg | DirectMARLEnvCfg, agen # specify directory for logging experiments config_name = agent_cfg["params"]["config"]["name"] log_root_path = os.path.join("logs", "rl_games", config_name) - if "pbt" in agent_cfg: - if agent_cfg["pbt"]["directory"] == ".": - log_root_path = os.path.abspath(log_root_path) - else: - log_root_path = os.path.join(agent_cfg["pbt"]["directory"], log_root_path) + if "pbt" in agent_cfg and agent_cfg["pbt"]["directory"] != ".": + log_root_path = os.path.join(agent_cfg["pbt"]["directory"], log_root_path) + else: + log_root_path = os.path.abspath(log_root_path) print(f"[INFO] Logging experiment in directory: {log_root_path}") # specify directory for logging runs