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 when resetting environment #17

Closed
lcdbezerra opened this issue Oct 27, 2022 · 1 comment
Closed

Error when resetting environment #17

lcdbezerra opened this issue Oct 27, 2022 · 1 comment

Comments

@lcdbezerra
Copy link

Hi. I just cloned the repo and tried to run the example in the readme file.

env = gym.make("Foraging-8x8-2p-1f-v2")
env.reset()

But then I got an error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/camaral/miniconda3/envs/lbforaging/lib/python3.7/site-packages/gym/wrappers/order_enforcing.py", line 42, in reset
    return self.env.reset(**kwargs)
  File "/home/camaral/miniconda3/envs/lbforaging/lib/python3.7/site-packages/gym/wrappers/env_checker.py", line 45, in reset
    return env_reset_passive_checker(self.env, **kwargs)
  File "/home/camaral/miniconda3/envs/lbforaging/lib/python3.7/site-packages/gym/utils/passive_env_checker.py", line 192, in env_reset_passive_checker
    result = env.reset(**kwargs)
  File "/home/camaral/code/lb-foraging/lbforaging/foraging/environment.py", line 470, in reset
    self.spawn_players(self.max_player_level)
  File "/home/camaral/code/lb-foraging/lbforaging/foraging/environment.py", line 291, in spawn_players
    row = self.np_random.randint(0, self.rows)
AttributeError: 'numpy.random._generator.Generator' object has no attribute 'randint'

This is probably related to the NumPy version, but it doesn't say anywhere which version to use

Dependencies:

python=3.7.13
gym=0.26.2
numpy=1.21.6
@lcdbezerra
Copy link
Author

Fixed with pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant