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

[Bug] Numpy Attribute Error on A2C learn() #929

Closed
3 tasks done
lagatorc opened this issue Jun 5, 2022 · 2 comments
Closed
3 tasks done

[Bug] Numpy Attribute Error on A2C learn() #929

lagatorc opened this issue Jun 5, 2022 · 2 comments
Labels
bug Something isn't working duplicate This issue or pull request already exists

Comments

@lagatorc
Copy link

lagatorc commented Jun 5, 2022

🐛 Bug

When I created an A2C model and ran the learn function I received an AttributeError from numpy.

To Reproduce

import gym
from stable_baselines3 import A2C
from stable_baselines3.common.vec_env import VecFrameStack
from stable_baselines3.common.env_util import make_atari_env

env = make_atari_env("Breakout-v0", n_envs=4, seed=0)
env = VecFrameStack(env, n_stack=4)

log_path = os.path.join("training", "logs")
model = A2C("CnnPolicy", env, verbose=True, tensorboard_log=log_path)

model.learn(total_timesteps=100000)

Expected behavior

model.learn() should throw this error:

AttributeError: 'numpy.random._generator.Generator' object has no attribute 'randint'

### System Info

OS: Linux-5.13.0-44-generic-x86_64-with-glibc2.10 #49~20.04.1-Ubuntu SMP Wed May 18 18:44:28 UTC 2022
Python: 3.8.5
Stable-Baselines3: 1.5.0
PyTorch: 1.11.0+cu102
GPU Enabled: False
Numpy: 1.22.4
Gym: 0.21.0

  • I have checked that there is no similar issue in the repo (required)
  • I have read the documentation (required)
  • I have provided a minimal working example to reproduce the bug (required)
@lagatorc lagatorc added the bug Something isn't working label Jun 5, 2022
@araffin araffin added the duplicate This issue or pull request already exists label Jun 5, 2022
@araffin
Copy link
Member

araffin commented Jun 5, 2022

Duplicate of #875

@araffin araffin marked this as a duplicate of #875 Jun 5, 2022
@araffin araffin closed this as completed Jun 5, 2022
@lagatorc
Copy link
Author

lagatorc commented Jun 5, 2022

Thank you, sorry I did not find that duplicate issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants