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

[All parallel environments have env-id 0 ] #312

Open
3 tasks done
RajGhugare19 opened this issue Aug 6, 2024 · 2 comments
Open
3 tasks done

[All parallel environments have env-id 0 ] #312

RajGhugare19 opened this issue Aug 6, 2024 · 2 comments
Assignees

Comments

@RajGhugare19
Copy link

RajGhugare19 commented Aug 6, 2024

Describe the bug

A clear and concise description of what the bug is.

To Reproduce

after using fresh anaconda env / venv installing a fresh envpool using pip install envpool , and running :

import gym
import envpool
import numpy as np

env = envpool.make_gym("Pong-v5", num_envs=2)

action_num = env.action_space.n

action = np.random.randint(action_num, size=2)
obs, rew, done, info = env.step(action)

print(info["env_id"]) 

Expected behavior

The expected output is [1, 2] but I keep getting [0, 0] for some reason.

System info

Describe the characteristic of your environment:

  • The libraries were installed on a fresh venv.
import envpool, numpy, sys
print(envpool.__version__, numpy.__version__, sys.version, sys.platform)

0.8.4 2.0.0 3.10.12 (main, Jul 29 2024, 16:56:48) [GCC 11.4.0] linux

Checklist

  • 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)
@RajGhugare19
Copy link
Author

RajGhugare19 commented Aug 7, 2024

I think this issue occurs because of some interplay between envpool and numpy==2.0.1. I downgraded to numpy==1.26.0 and it works now.

@lionelblonde
Copy link

To add on to the issue/bug description: whatever the number of environment the pool, a call to reset would get me a numpy array where all the values where identical (across the observation and across the pool dimension). I was using numpy==2.0.1. Thanks to the previous comment, I changed to numpy==1.26.0, and the phenomenon I have just described does not occur anymore.

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

3 participants