diff --git a/scripts/benchmarks/benchmark_rsl_rl.py b/scripts/benchmarks/benchmark_rsl_rl.py index 8e3b4e132a5..4b803d59e5d 100644 --- a/scripts/benchmarks/benchmark_rsl_rl.py +++ b/scripts/benchmarks/benchmark_rsl_rl.py @@ -77,7 +77,7 @@ from isaaclab.utils.dict import print_dict from isaaclab.utils.io import dump_yaml -from isaaclab_rl.rsl_rl import RslRlOnPolicyRunnerCfg, RslRlVecEnvWrapper +from isaaclab_rl.rsl_rl import RslRlOnPolicyRunnerCfg, RslRlVecEnvWrapper, handle_deprecated_rsl_rl_cfg import isaaclab_tasks # noqa: F401 from isaaclab_tasks.utils import get_checkpoint_path @@ -197,6 +197,9 @@ def main(env_cfg: ManagerBasedRLEnvCfg | DirectRLEnvCfg | DirectMARLEnvCfg, agen task_startup_time_end = time.perf_counter_ns() # create runner from rsl-rl + import importlib.metadata + installed_version = importlib.metadata.version("rsl-rl-lib") + agent_cfg = handle_deprecated_rsl_rl_cfg(agent_cfg, installed_version) runner = OnPolicyRunner(env, agent_cfg.to_dict(), log_dir=log_dir, device=agent_cfg.device) # write git state to logs runner.add_git_repo_to_log(__file__) @@ -229,13 +232,13 @@ def main(env_cfg: ManagerBasedRLEnvCfg | DirectRLEnvCfg | DirectMARLEnvCfg, agen # prepare RL timing dict collection_fps = ( 1 - / (np.array(log_data["Perf/collection time"])) + / (np.array(log_data["Perf/collection_time"])) * env.unwrapped.num_envs * agent_cfg.num_steps_per_env * world_size ) rl_training_times = { - "Collection Time": (np.array(log_data["Perf/collection time"]) / 1000).tolist(), + "Collection Time": (np.array(log_data["Perf/collection_time"]) / 1000).tolist(), "Learning Time": (np.array(log_data["Perf/learning_time"]) / 1000).tolist(), "Collection FPS": collection_fps.tolist(), "Total FPS": log_data["Perf/total_fps"] * world_size,