deep-rl-class
deep-rl-class copied to clipboard
[HANDS-ON BUG]
Describe the bug
Problem with Unit 3: Deep Q-Learning with Atari Games 👾 using RL Baselines3 Zoo
Hello, I have an issue with pushing the model to hub.
I execute the line:
!python -m rl_zoo3.push_to_hub --algo dqn --env SpaceInvadersNoFrameskip-v4 --repo-name dqn-SpaceInvadersNoFrameskip-v4 -orga execbat -f logs/
Getting this:
Loading latest experiment, id=1 Loading logs/dqn/SpaceInvadersNoFrameskip-v4_1/SpaceInvadersNoFrameskip-v4.zip A.L.E: Arcade Learning Environment (version 0.8.1+53f58b7) [Powered by Stella] Stacking 4 frames Wrapping the env in a VecTransposeImage. Uploading to execbat/dqn-SpaceInvadersNoFrameskip-v4, make sure to have the rights ℹ This function will save, evaluate, generate a video of your agent, create a model card and push everything to the hub. It might take up to some minutes if video generation is activated. This is a work in progress: if you encounter a bug, please open an issue. /home/evgenii/anaconda3/envs/huggingface/lib/python3.9/site-packages/huggingface_hub/utils/_deprecation.py:131: FutureWarning: 'Repository' (from 'huggingface_hub.repository') is deprecated and will be removed from version '1.0'. Please prefer the http-based alternatives instead. Given its large adoption in legacy code, the complete removal is only planned on next major release. For more details, please read https://huggingface.co/docs/huggingface_hub/concepts/git_vs_http. warnings.warn(warning_message, FutureWarning) Cloning https://huggingface.co/execbat/dqn-SpaceInvadersNoFrameskip-v4 into local empty directory. WARNING:huggingface_hub.repository:Cloning https://huggingface.co/execbat/dqn-SpaceInvadersNoFrameskip-v4 into local empty directory. Saving model to: hub/dqn-SpaceInvadersNoFrameskip-v4/dqn-SpaceInvadersNoFrameskip-v4 Traceback (most recent call last): File "/home/evgenii/anaconda3/envs/huggingface/lib/python3.9/runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "/home/evgenii/anaconda3/envs/huggingface/lib/python3.9/runpy.py", line 87, in _run_code exec(code, run_globals) File "/home/evgenii/anaconda3/envs/huggingface/lib/python3.9/site-packages/rl_zoo3/push_to_hub.py", line 398, in <module> package_to_hub( File "/home/evgenii/anaconda3/envs/huggingface/lib/python3.9/site-packages/rl_zoo3/push_to_hub.py", line 247, in package_to_hub _generate_replay(model, eval_env, video_length, is_deterministic, repo_local_path) File "/home/evgenii/anaconda3/envs/huggingface/lib/python3.9/site-packages/huggingface_sb3/push_to_hub.py", line 133, in _generate_replay env = VecVideoRecorder( File "/home/evgenii/anaconda3/envs/huggingface/lib/python3.9/site-packages/stable_baselines3/common/vec_env/vec_video_recorder.py", line 52, in __init__ assert self.env.render_mode == "rgb_array", f"The render_mode must be 'rgb_array', not {self.env.render_mode}" AssertionError: The render_mode must be 'rgb_array', not human Exception ignored in: <function VecVideoRecorder.__del__ at 0x73db523815e0> Traceback (most recent call last): File "/home/evgenii/anaconda3/envs/huggingface/lib/python3.9/site-packages/stable_baselines3/common/vec_env/vec_video_recorder.py", line 113, in __del__ self.close_video_recorder() File "/home/evgenii/anaconda3/envs/huggingface/lib/python3.9/site-packages/stable_baselines3/common/vec_env/vec_video_recorder.py", line 103, in close_video_recorder if self.recording: File "/home/evgenii/anaconda3/envs/huggingface/lib/python3.9/site-packages/stable_baselines3/common/vec_env/base_vec_env.py", line 420, in __getattr__ return self.getattr_recursive(name) File "/home/evgenii/anaconda3/envs/huggingface/lib/python3.9/site-packages/stable_baselines3/common/vec_env/base_vec_env.py", line 443, in getattr_recursive attr = self.venv.getattr_recursive(name) File "/home/evgenii/anaconda3/envs/huggingface/lib/python3.9/site-packages/stable_baselines3/common/vec_env/base_vec_env.py", line 445, in getattr_recursive attr = getattr(self.venv, name) AttributeError: 'DummyVecEnv' object has no attribute 'recording'
So I don;t know how to get the replay file and push altogether to my huggingface repository. Please help. unit3.zip
Material
I made it in conda env on my laptop. env built on python 3.9.18
-OS: Ubuntu 22.04.3 LTS
- OS type: 64-bit
- Processor: Intel® Core™ i9-9880H CPU @ 2.30GHz × 8