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

Python error AssertionError: Observation space ... does not inherit from gym.spaces.Space #43

Open
nickponline opened this issue Jun 23, 2022 · 3 comments
Assignees

Comments

@nickponline
Copy link

(dev) [nickp@m1 baba-babaisyou-v0 (main)]$ python3 DQN.py 
Traceback (most recent call last):
  File "DQN.py", line 16, in <module>
    env = gym.make('baba-babaisyou-v0')
  File "/Users/nickp/opt/anaconda3/envs/dev/lib/python3.7/site-packages/gym/envs/registration.py", line 601, in make
    env = PassiveEnvChecker(env)
  File "/Users/nickp/opt/anaconda3/envs/dev/lib/python3.7/site-packages/gym/wrappers/env_checker.py", line 25, in __init__
    check_observation_space(env.action_space)
  File "/Users/nickp/opt/anaconda3/envs/dev/lib/python3.7/site-packages/gym/utils/passive_env_checker.py", line 145, in check_observation_space
    f"Observation space ({observation_space}) does not inherit from gym.spaces.Space"
AssertionError: Observation space ([<Direction.UP: 1>, <Direction.DOWN: 2>, <Direction.LEFT: 3>, <Direction.RIGHT: 4>]) does not inherit from gym.spaces.Space
Python 3.7.10
gym.__version__ = '0.24.1'
@utilForever
Copy link
Owner

Thanks for report! I'll check it tonight. 😉

@Orr-Bezalely
Copy link

Orr-Bezalely commented Dec 15, 2022

Hi,
I ran into the same issue and I believe it is due to gym being updated to a later version which is more strict regarding the creation of custom environments.
Running the code on gym version 0.21.0 works for me.

@BrianPark314
Copy link

does anyone know how to update the code to match the lateest version?

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

No branches or pull requests

4 participants