You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Atari environment produces blank output when having numpy>=2 installed.
Installing numpy<2 (which resolves to numpy-1.26.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl) fixes the issue.
Here, blank output means RGB (0, 0, 0) for Breakout-v5.
Pong-v5 produces RGB (89, 89, 89) instead.
To Reproduce
pip install -U envpool opencv-python
# To fix the issue:
pip install -U 'numpy<2'# To reproduce the issue:
pip install -U 'numpy>=2'
importnumpyasnpimportenvpoolimportcv2env_id="Pong-v5"# gray_scale does not affect this issueenv=envpool.make_gymnasium(
env_id,
num_envs=16,
max_episode_steps=3600,
stack_num=1,
gray_scale=False,
episodic_life=True,
repeat_action_probability=0.25,
use_fire_reset=True,
)
for_inrange(1000):
next_obs, reward, terminations, truncations, infos=env.step(np.zeros(args.num_envs, dtype="int32"))
cv2.imshow("img", np.moveaxis(next_obs[0], 0, -1))
cv2.waitKey(10)
Expected behavior
Either work with numpy 2 or declare to not support numpy>2.
System info
Describe the characteristic of your environment:
Installed via pip inside venv
Using python 3.10.12
Working inside WSL 2 (Windows Subsystem Linux)
importenvpool, numpy, sysprint(envpool.__version__, numpy.__version__, sys.version, sys.platform)
# 0.8.4 1.26.4 3.10.12 (main, Nov 6 2024, 20:22:13) [GCC 11.4.0] linux
Reason and Possible fixes
This project declares support for any numpy version. That is broken by design as numpy bumping its major version can cause issue at any time. It is extra confusing as things work perfectly for people who have not upgraded numpy yet.
While this issue should be fixed at some point, I think adding numpy<2 is good for now. With that being said, I propose to add version constraint like <2 to prevent upgrading major version for every dependency that is not alpha (e.g. 0.1.2).
Describe the bug
Atari environment produces blank output when having
numpy>=2
installed.Installing
numpy<2
(which resolves tonumpy-1.26.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
) fixes the issue.Here, blank output means RGB (0, 0, 0) for Breakout-v5.
Pong-v5 produces RGB (89, 89, 89) instead.
To Reproduce
Expected behavior
Either work with numpy 2 or declare to not support numpy>2.
System info
Describe the characteristic of your environment:
Reason and Possible fixes
This project declares support for any numpy version. That is broken by design as numpy bumping its major version can cause issue at any time. It is extra confusing as things work perfectly for people who have not upgraded numpy yet.
While this issue should be fixed at some point, I think adding
numpy<2
is good for now. With that being said, I propose to add version constraint like<2
to prevent upgrading major version for every dependency that is not alpha (e.g.0.1.2
).If you plan to tackle on the root cause of this issue, this article from numpy documentation might be helpful.
Checklist
The text was updated successfully, but these errors were encountered: