Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cleanrl/dqn.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ def parse_args():
help="the frequency of training")
args = parser.parse_args()
# fmt: on
assert args.num_envs == 1, "vectorized envs are not supported at the moment"

return args

Expand Down Expand Up @@ -167,6 +166,7 @@ def linear_schedule(start_e: float, end_e: float, duration: int, t: int):
envs.single_observation_space,
envs.single_action_space,
device,
n_envs=args.num_envs,
handle_timeout_termination=False,
)
start_time = time.time()
Expand All @@ -189,7 +189,7 @@ def linear_schedule(start_e: float, end_e: float, duration: int, t: int):
if "final_info" in infos:
for info in infos["final_info"]:
# Skip the envs that are not done
if "episode" not in info:
if info is None or "episode" not in info:
continue
print(f"global_step={global_step}, episodic_return={info['episode']['r']}")
writer.add_scalar("charts/episodic_return", info["episode"]["r"], global_step)
Expand Down