Skip to content

Capture-video flag doesn't work with ppo continuous #503

@RishiMalhotra920

Description

@RishiMalhotra920

I installed packages using

pip install moviepy==1.0.3 pygame==2.1.0 rich<12.0 tenacity==8.2.2 gymnasium==0.28.1 torch numpy

but I find that the capture-video flag throws errors. I have pasted the command I run and the error below.

My training command.

python -m cleanrl.ppo_continuous_action --env-id Pendulum-v1 --exp-name ppo --seed 1 --track --wandb-project-name cleanRL --gamma 0.99 --vf-coef 0.5 --ent-coef 0.01 --norm-adv --num-envs 4  --clip-coef 0.2 --num-steps 2048 --clip-vloss --gae-lambda 0.95 --learning-rate 3e-4 --anneal-lr --max-grad-norm 0.5 --update-epochs 20 --num-minibatches 4 --total-timesteps 5000000 --torch-deterministic --exp-name long-experiment-low-lr-custom-annealing --capture-video
Traceback (most recent call last):
  File "/opt/anaconda3/envs/cleanrl_env2/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/opt/anaconda3/envs/cleanrl_env2/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/Users/rishimalhotra/projects/lm_from_scratch/rl/cleanrl/cleanrl/ppo_continuous_action.py", line 223, in <module>
    next_obs, reward, terminations, truncations, infos = envs.step(action.cpu().numpy())
  File "/opt/anaconda3/envs/cleanrl_env2/lib/python3.10/site-packages/gymnasium/vector/vector_env.py", line 203, in step
    return self.step_wait()
  File "/opt/anaconda3/envs/cleanrl_env2/lib/python3.10/site-packages/gymnasium/vector/sync_vector_env.py", line 149, in step_wait
    ) = env.step(action)
  File "/opt/anaconda3/envs/cleanrl_env2/lib/python3.10/site-packages/gymnasium/core.py", line 502, in step
    observation, reward, terminated, truncated, info = self.env.step(action)
  File "/opt/anaconda3/envs/cleanrl_env2/lib/python3.10/site-packages/gymnasium/wrappers/normalize.py", line 133, in step
    obs, rews, terminateds, truncateds, infos = self.env.step(action)
  File "/opt/anaconda3/envs/cleanrl_env2/lib/python3.10/site-packages/gymnasium/core.py", line 469, in step
    observation, reward, terminated, truncated, info = self.env.step(action)
  File "/opt/anaconda3/envs/cleanrl_env2/lib/python3.10/site-packages/gymnasium/wrappers/normalize.py", line 76, in step
    obs, rews, terminateds, truncateds, infos = self.env.step(action)
  File "/opt/anaconda3/envs/cleanrl_env2/lib/python3.10/site-packages/gymnasium/core.py", line 538, in step
    return self.env.step(self.action(action))
  File "/opt/anaconda3/envs/cleanrl_env2/lib/python3.10/site-packages/gymnasium/wrappers/record_episode_statistics.py", line 89, in step
    ) = self.env.step(action)
  File "/opt/anaconda3/envs/cleanrl_env2/lib/python3.10/site-packages/gymnasium/core.py", line 469, in step
    observation, reward, terminated, truncated, info = self.env.step(action)
  File "/opt/anaconda3/envs/cleanrl_env2/lib/python3.10/site-packages/gymnasium/wrappers/record_video.py", line 172, in step
    self.video_recorder.capture_frame()
  File "/opt/anaconda3/envs/cleanrl_env2/lib/python3.10/site-packages/gymnasium/wrappers/monitoring/video_recorder.py", line 114, in capture_frame
    frame = self.env.render()
  File "/opt/anaconda3/envs/cleanrl_env2/lib/python3.10/site-packages/gymnasium/core.py", line 418, in render
    return self.env.render()
  File "/opt/anaconda3/envs/cleanrl_env2/lib/python3.10/site-packages/gymnasium/wrappers/order_enforcing.py", line 70, in render
    return self.env.render(*args, **kwargs)
  File "/opt/anaconda3/envs/cleanrl_env2/lib/python3.10/site-packages/gymnasium/wrappers/env_checker.py", line 65, in render
    return self.env.render(*args, **kwargs)
  File "/opt/anaconda3/envs/cleanrl_env2/lib/python3.10/site-packages/gymnasium/envs/classic_control/pendulum.py", line 237, in render
    scale_img = pygame.transform.smoothscale(
TypeError: size must be two numbers

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions