Farama-Foundation / Arcade-Learning-Environment

The Arcade Learning Environment (ALE) -- a platform for AI research.
https://ale.farama.org/
GNU General Public License v2.0
2.18k stars 424 forks source link

`obs_type="ram"` returns constant #534

Closed pseudo-rnd-thoughts closed 3 months ago

pseudo-rnd-thoughts commented 4 months ago
import numpy as np
import gymnasium as gym
import ale_py

gym.register_envs(ale_py)

# env = gym.make( "ALE/Breakout-v5", obs_type="ram", render_mode="human")
env = gym.make( "ALE/MsPacman-v5", obs_type="ram", render_mode="human")

obs, _ = env.reset()
for step in range(100):
    action = env.action_space.sample()
    observation, reward, terminated, truncated, info = env.step(action)
    print(observation)
    print(step, action, observation.shape, np.unique(observation))

env.close()

Using obs_type="ram" means that the observation elements are constant. This implies that the obs_type is bugged, most likely occurring during the update to 0.9.0

pseudo-rnd-thoughts commented 4 months ago

The problem is due to NumPy 2.0 for some reason, unclear why currently

pseudo-rnd-thoughts commented 4 months ago

ALE 0.9.0 was compiled with pybind 2.10.0, 2.12.0 is required for compatibility with NumPy 2.0