diff --git a/scripts/tracking/rl/train.py b/scripts/tracking/rl/train.py index 013aee962..7d01eb1e3 100644 --- a/scripts/tracking/rl/train.py +++ b/scripts/tracking/rl/train.py @@ -66,7 +66,7 @@ def main( log_dir = log_root_path / log_dir # Create env. - env = gym.make(task, cfg=env_cfg) + env = gym.make(task, cfg=env_cfg, render_mode="rgb_array" if video else None) # Save resume path before creating a new log_dir. resume_path = None diff --git a/scripts/velocity/rl/play.py b/scripts/velocity/rl/play.py index d84336ae7..e05bcbbdd 100644 --- a/scripts/velocity/rl/play.py +++ b/scripts/velocity/rl/play.py @@ -26,8 +26,6 @@ KEY_BACKSPACE = 259 KEY_ENTER = 257 -_HERE = Path(__file__).parent - def main( task: str, @@ -52,7 +50,7 @@ def main( env_cfg.sim.render.height = video_height or env_cfg.sim.render.height env_cfg.sim.render.width = video_width or env_cfg.sim.render.width - log_root_path = _HERE / "logs" / "rsl_rl" / agent_cfg.experiment_name + log_root_path = Path("logs") / "rsl_rl" / agent_cfg.experiment_name log_root_path = log_root_path.resolve() print(f"[INFO]: Loading experiment from: {log_root_path}") diff --git a/scripts/velocity/rl/train.py b/scripts/velocity/rl/train.py index 97b9454eb..ffc571640 100644 --- a/scripts/velocity/rl/train.py +++ b/scripts/velocity/rl/train.py @@ -24,8 +24,6 @@ torch.backends.cudnn.deterministic = False torch.backends.cudnn.benchmark = False -_HERE = Path(__file__).parent - def main( task: str, @@ -51,7 +49,7 @@ def main( env_cfg.sim.device = device or env_cfg.sim.device # Specify directory for logging experiments. - log_root_path = _HERE / "logs" / "rsl_rl" / agent_cfg.experiment_name + log_root_path = Path("logs") / "rsl_rl" / agent_cfg.experiment_name log_root_path.resolve() print(f"[INFO] Logging experiment in directory: {log_root_path}") log_dir = datetime.now().strftime("%Y-%m-%d_%H-%M-%S") @@ -60,7 +58,7 @@ def main( log_dir = log_root_path / log_dir # Create env. - env = gym.make(task, cfg=env_cfg) + env = gym.make(task, cfg=env_cfg, render_mode="rgb_array" if video else None) # Save resume path before creating a new log_dir. resume_path = (