Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Error]: I got unexpected error using enjoy() with pretrain model #428

Closed
5 tasks done
tiencapham opened this issue Dec 5, 2023 · 4 comments
Closed
5 tasks done
Labels
bug Something isn't working

Comments

@tiencapham
Copy link

🐛 Bug

I just install as in README.md file and try to 'enjoy' the pretrained model with Atari games. But I got and error as below, it seems sb3-zoo fail to register the environment.

To Reproduce

python enjoy.py --algo a2c --env BreakoutNoFrameskip-v4 --folder rl-trained-agents/ -n 5000

Relevant log output / Error message

rl-baselines3-zoo\enjoy.py", line 4, in <module> enjoy()
rl-baselines3-zoo\rl_zoo3\enjoy.py", line 138, in enjoy
    is_atari = ExperimentManager.is_atari(env_name.gym_id)
rl-baselines3-zoo\rl_zoo3\exp_manager.py", line 533, in is_atari
    return "AtariEnv" in ExperimentManager.entry_point(env_id)
rl-baselines3-zoo\rl_zoo3\exp_manager.py", line 528, in entry_point
    return str(gym.envs.registry[env_id].entry_point)
KeyError: 'BreakoutNoFrameskip-v4'

System Info

  • OS: Windows-10-10.0.22621-SP0 10.0.22621
  • Python: 3.9.18
  • Stable-Baselines3: 2.2.1
  • PyTorch: 2.1.1+cpu
  • GPU Enabled: False
  • Numpy: 1.26.2
  • Cloudpickle: 3.0.0
  • Gymnasium: 0.29.1
  • OpenAI Gym: 0.26.2

Checklist

@tiencapham tiencapham added the bug Something isn't working label Dec 5, 2023
@qgallouedec
Copy link
Collaborator

Hi, make sure to install atari envs.

pip install stable-baselines3[extra]

Answer in the doc: https://stable-baselines3.readthedocs.io/en/master/guide/examples.html#id2

@tiencapham
Copy link
Author

Hi, make sure to install atari envs.

pip install stable-baselines3[extra]

Answer in the doc: https://stable-baselines3.readthedocs.io/en/master/guide/examples.html#id2

Hi,
Thank for your response.

I actually modified the stable-baseline3 and installed it from source. Maybe that is the reason I missed this step.

How can I install the atari envs in this case?

Best,
Tien Pham

@qgallouedec
Copy link
Collaborator

qgallouedec commented Dec 5, 2023

The answer is still in the doc, in the exact same paragraph :)

pip install gymnasium[atari, accept-rom-license]

Command out-of-date in the doc, fixed by DLR-RM/stable-baselines3#1773

@tiencapham
Copy link
Author

Silly me, but I solved it by:

pip install -e .[docs,tests,extra] in stable baseline.

Thanks for your help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants