[x] I have checked that there is no similar issue in the repo (required)
Current Behavior
python ppo.py --seed 1 --env-id CartPole-v0 --total-timesteps 50000 --capture-video
/home/gitpod/.pyenv/versions/3.8.12/lib/python3.8/site-packages/torch/utils/tensorboard/init.py:4: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
if not hasattr(tensorboard, "version") or LooseVersion(
/home/gitpod/.pyenv/versions/3.8.12/lib/python3.8/site-packages/gym/envs/registration.py:505: UserWarning: WARN: The environment CartPole-v0 is out of date. You should consider upgrading to version v1 with the environment ID CartPole-v1.
logger.warn(
/home/gitpod/.pyenv/versions/3.8.12/lib/python3.8/site-packages/gym/core.py:172: DeprecationWarning: WARN: Function env.seed(seed) is marked as deprecated and will be removed in the future. Please use env.reset(seed=seed) instead. deprecation( /home/gitpod/.pyenv/versions/3.8.12/lib/python3.8/site-packages/gym/wrappers/monitoring/video_recorder.py:115: DeprecationWarning: WARN:env.metadata["video.frames_per_second"] is marked as deprecated and will be replaced with env.metadata["render_fps"] see https://github.com/openai/gym/pull/2654 for more details
logger.deprecation(
Traceback (most recent call last):
File "ppo.py", line 179, in
next_obs = torch.Tensor(envs.reset()).to(device)
File "/home/gitpod/.pyenv/versions/3.8.12/lib/python3.8/site-packages/gym/vector/vector_env.py", line 80, in reset
return self.reset_wait(seed=seed, return_info=return_info, options=options)
File "/home/gitpod/.pyenv/versions/3.8.12/lib/python3.8/site-packages/gym/vector/sync_vector_env.py", line 115, in reset_wait
observation = env.reset(kwargs)
File "/home/gitpod/.pyenv/versions/3.8.12/lib/python3.8/site-packages/gym/wrappers/record_video.py", line 58, in reset
self.start_video_recorder()
File "/home/gitpod/.pyenv/versions/3.8.12/lib/python3.8/site-packages/gym/wrappers/record_video.py", line 75, in start_video_recorder
self.video_recorder.capture_frame()
File "/home/gitpod/.pyenv/versions/3.8.12/lib/python3.8/site-packages/gym/wrappers/monitoring/video_recorder.py", line 157, in capture_frame
frame = self.env.render(mode=render_mode)
File "/home/gitpod/.pyenv/versions/3.8.12/lib/python3.8/site-packages/gym/core.py", line 286, in render
return self.env.render(mode, kwargs)
File "/home/gitpod/.pyenv/versions/3.8.12/lib/python3.8/site-packages/gym/core.py", line 286, in render
return self.env.render(mode, kwargs)
File "/home/gitpod/.pyenv/versions/3.8.12/lib/python3.8/site-packages/gym/core.py", line 286, in render
return self.env.render(mode, kwargs)
File "/home/gitpod/.pyenv/versions/3.8.12/lib/python3.8/site-packages/gym/envs/classic_control/cartpole.py", line 265, in render
np.array(pygame.surfarray.pixels3d(self.screen)), axes=(1, 0, 2)
File "/home/gitpod/.pyenv/versions/3.8.12/lib/python3.8/site-packages/pygame/surfarray.py", line 187, in pixels3d
return numpy_array(surface.get_view('3'), copy=False)
ValueError: unsupported bit depth 16 for 3D reference array
Exception ignored in: <function VideoRecorder.del at 0x7f2f695fb1f0>
Traceback (most recent call last):
File "/home/gitpod/.pyenv/versions/3.8.12/lib/python3.8/site-packages/gym/wrappers/monitoring/video_recorder.py", line 222, in del
File "/home/gitpod/.pyenv/versions/3.8.12/lib/python3.8/site-packages/gym/wrappers/monitoring/video_recorder.py", line 211, in close
File "/home/gitpod/.pyenv/versions/3.8.12/lib/python3.8/site-packages/gym/wrappers/monitoring/video_recorder.py", line 217, in write_metadata
NameError: name 'open' is not defined
Problem Description
Unable to render video when using gitpod.
Checklist
poetry install
(see CleanRL's installation guideline.Current Behavior
python ppo.py --seed 1 --env-id CartPole-v0 --total-timesteps 50000 --capture-video /home/gitpod/.pyenv/versions/3.8.12/lib/python3.8/site-packages/torch/utils/tensorboard/init.py:4: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead. if not hasattr(tensorboard, "version") or LooseVersion( /home/gitpod/.pyenv/versions/3.8.12/lib/python3.8/site-packages/gym/envs/registration.py:505: UserWarning: WARN: The environment CartPole-v0 is out of date. You should consider upgrading to version
next_obs = torch.Tensor(envs.reset()).to(device)
File "/home/gitpod/.pyenv/versions/3.8.12/lib/python3.8/site-packages/gym/vector/vector_env.py", line 80, in reset
return self.reset_wait(seed=seed, return_info=return_info, options=options)
File "/home/gitpod/.pyenv/versions/3.8.12/lib/python3.8/site-packages/gym/vector/sync_vector_env.py", line 115, in reset_wait
observation = env.reset(kwargs)
File "/home/gitpod/.pyenv/versions/3.8.12/lib/python3.8/site-packages/gym/wrappers/record_video.py", line 58, in reset
self.start_video_recorder()
File "/home/gitpod/.pyenv/versions/3.8.12/lib/python3.8/site-packages/gym/wrappers/record_video.py", line 75, in start_video_recorder
self.video_recorder.capture_frame()
File "/home/gitpod/.pyenv/versions/3.8.12/lib/python3.8/site-packages/gym/wrappers/monitoring/video_recorder.py", line 157, in capture_frame
frame = self.env.render(mode=render_mode)
File "/home/gitpod/.pyenv/versions/3.8.12/lib/python3.8/site-packages/gym/core.py", line 286, in render
return self.env.render(mode, kwargs)
File "/home/gitpod/.pyenv/versions/3.8.12/lib/python3.8/site-packages/gym/core.py", line 286, in render
return self.env.render(mode, kwargs)
File "/home/gitpod/.pyenv/versions/3.8.12/lib/python3.8/site-packages/gym/core.py", line 286, in render
return self.env.render(mode, kwargs)
File "/home/gitpod/.pyenv/versions/3.8.12/lib/python3.8/site-packages/gym/envs/classic_control/cartpole.py", line 265, in render
np.array(pygame.surfarray.pixels3d(self.screen)), axes=(1, 0, 2)
File "/home/gitpod/.pyenv/versions/3.8.12/lib/python3.8/site-packages/pygame/surfarray.py", line 187, in pixels3d
return numpy_array(surface.get_view('3'), copy=False)
ValueError: unsupported bit depth 16 for 3D reference array
Exception ignored in: <function VideoRecorder.del at 0x7f2f695fb1f0>
Traceback (most recent call last):
File "/home/gitpod/.pyenv/versions/3.8.12/lib/python3.8/site-packages/gym/wrappers/monitoring/video_recorder.py", line 222, in del
File "/home/gitpod/.pyenv/versions/3.8.12/lib/python3.8/site-packages/gym/wrappers/monitoring/video_recorder.py", line 211, in close
File "/home/gitpod/.pyenv/versions/3.8.12/lib/python3.8/site-packages/gym/wrappers/monitoring/video_recorder.py", line 217, in write_metadata
NameError: name 'open' is not defined
v1
with the environment IDCartPole-v1
. logger.warn( /home/gitpod/.pyenv/versions/3.8.12/lib/python3.8/site-packages/gym/core.py:172: DeprecationWarning: WARN: Functionenv.seed(seed)
is marked as deprecated and will be removed in the future. Please useenv.reset(seed=seed) instead. deprecation( /home/gitpod/.pyenv/versions/3.8.12/lib/python3.8/site-packages/gym/wrappers/monitoring/video_recorder.py:115: DeprecationWarning: WARN:
env.metadata["video.frames_per_second"] is marked as deprecated and will be replaced withenv.metadata["render_fps"]
see https://github.com/openai/gym/pull/2654 for more details logger.deprecation( Traceback (most recent call last): File "ppo.py", line 179, inExpected Behavior
capture a video as shown in https://docs.cleanrl.dev/get-started/basic-usage/#visualize-the-agents-gameplay-videos
Possible Solution
Steps to Reproduce
python ppo.py --seed 1 --env-id CartPole-v0 --total-timesteps 50000 --capture-video
in gitpods terminal inside /workspace/cleanrl/cleanrl