Skip to content

Commit 6a09bd3

Browse files
authored
Enable video recording for ppo_procgen.py (#166)
1 parent 6c39975 commit 6a09bd3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

cleanrl/ppo_procgen.py

+2
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,8 @@ def get_action_and_value(self, x, action=None):
190190
envs.single_observation_space = envs.observation_space["rgb"]
191191
envs.is_vector_env = True
192192
envs = gym.wrappers.RecordEpisodeStatistics(envs)
193+
if args.capture_video:
194+
envs = gym.wrappers.RecordVideo(envs, f"videos/{run_name}")
193195
envs = gym.wrappers.NormalizeReward(envs)
194196
envs = gym.wrappers.TransformReward(envs, lambda reward: np.clip(reward, -10, 10))
195197
assert isinstance(envs.single_action_space, gym.spaces.Discrete), "only discrete action space is supported"

0 commit comments

Comments
 (0)