Farama-Foundation / Gymnasium

An API standard for single-agent reinforcement learning environments, with popular reference environments and related utilities (formerly Gym)
https://gymnasium.farama.org
MIT License
7.39k stars 836 forks source link

[Bug Report] RAM observations for Atari environment constant? #1090

Closed breuderink closed 4 months ago

breuderink commented 5 months ago

Describe the bug

I am trying to train an agent on the Atari environments. I just noticed that the observation is the value 63 repeated, where I expect the observation to have some variability, and change over time.

Code example

import numpy as np
import gymnasium as gym

env = gym.make( "ALE/Breakout-v5", obs_type="ram")
env.reset()

for step in range(10):
    action = env.action_space.sample()
    observation, reward, terminated, truncated, info = env.step(action)
    print(step, action, observation.shape, np.unique(observation)) constant.

'''
0 0 (128,) [63]
1 3 (128,) [63]
2 1 (128,) [63]
3 1 (128,) [63]
4 3 (128,) [63]
5 3 (128,) [63]
6 0 (128,) [63]
7 1 (128,) [63]
8 2 (128,) [63]
9 0 (128,) [63]
'''

System info

I installed gymnasium (0.29.1) in GitHub Codespaces (after having installation trouble on macOS):

$ uname -a
Linux codespaces-ec443d 6.5.0-1021-azure #22~22.04.1-Ubuntu SMP Tue Apr 30 16:08:18 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
$ python --version
Python 3.10.12

Additional context

No response

Checklist

pseudo-rnd-thoughts commented 4 months ago

Thanks for the report, this isn't the right repo but I have opened a new issue on the right one for you to follow https://github.com/Farama-Foundation/Arcade-Learning-Environment/issues/534

pseudo-rnd-thoughts commented 4 months ago

@breuderink The problem is related to NumPy 2.0, I would use pip install numpy<2 in the meantime