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

gym.error.UnregisteredEnv #6

Open
joongsoo opened this issue May 22, 2017 · 6 comments
Open

gym.error.UnregisteredEnv #6

joongsoo opened this issue May 22, 2017 · 6 comments

Comments

@joongsoo
Copy link

Hi. gym don't make supermario

gym.error.UnregisteredEnv: No registered env with id: ppaquette/SuperMarioBros-7-2-v0

all version same.

@Jackiexiao
Copy link

Jackiexiao commented Jun 20, 2017

I seems I have found the solution, you can follow the gym-wiki to register env manually.
git clone https://github.com/ppaquette/gym-super-mario
On my computer
cp -r ~/gym-super-mario/ppaquette_gym_super_mario ~/gym/gym/envs
Register env in /gym/envs/init.py:

register(
     id='SuperMarioBros-1-1-v0',
     entry_point='gym.envs.ppaquette_gym_super_mario:MetaSuperMarioBrosEnv',
)

Add your environment to the scoreboard in /gym/scoreboard/init.py

add_group(
     id='ppaquette_gym_super_mario',
     name='ppaquette_gym_super_mario',
     description='super_mario'
 )

 # mario bros
 add_task(
     id='ppaquette/SuperMarioBros-1-1-v0',
     group='ppaquette_gym_super_mario',
     summary="SuperMarioBros-1-1-v0"
  )

It works for me , you can test it by create a python file: test.py

import gym 
env = gym.make('SuperMarioBros-1-1-v0')
observation = env.reset()
for _ in range(1000):
    env.render()
    action = env.action_space.sample() # your agent here (this takes random actions)
    observation, reward, done, info = env.step(action)

@borosdenes
Copy link

borosdenes commented Nov 5, 2017

Please note that gym changed 21 days ago, resulting in major change within gym/scoreboard. For me the only solution was to revert gym to the state where scoreboard was still at old version. See #16

Please also note that based on @Jackiexiao suludion only gym.make('SuperMarioBros-1-1-v0') will work.

@liuny05
Copy link

liuny05 commented Dec 18, 2017

@Jackiexiao's method solve my problem. But it's not very specific and has a few mistakes.
More specifically, first clone the repository git clone https://github.com/ppaquette/gym-super-mario
Then copy ppaquette_gym_super_mario to your gym/envs directory, for me it's /usr/local/lib/python3.5/dist-packages/gym/envs/
So the command is cp -r gym-super-mario/ppaquette_gym_super_mario /usr/local/lib/python3.5/dist-packages/gym/envs/
Add this to your gym/envs/__init__.py to register env

register(
     id='SuperMarioBros-1-1-v0',
     entry_point='gym.envs.ppaquette_gym_super_mario:MetaSuperMarioBrosEnv',
)

Add your environment to the scoreboard in your /gym/scoreboard/__init__.py

add_group(
     id='ppaquette_gym_super_mario',
     name='ppaquette_gym_super_mario',
     description='super_mario'
)

# mario bros
add_task(
     id='ppaquette/SuperMarioBros-1-1-v0',
     group='ppaquette_gym_super_mario',
     summary="SuperMarioBros-1-1-v0"
)

Now we done, you can test by this code

import gym 
env = gym.make('SuperMarioBros-1-1-v0')
observation = env.reset()
for _ in range(1000):
    env.render()
    action = env.action_space.sample() # your agent here (this takes random actions)
    observation, reward, done, info = env.step(action)

And the gym_pull code doesn't work now.

@hughperkins
Copy link

Cool. Nuance: you can get that path for the cp command etc by doing python -c 'import gym; print(gym.__path__[0])', so a generic cp command could be eg:

cp -r gym-super-mario/ppaquette_gym_super_mario \
    $(python -c 'import gym; print(gym.__path__[0])')/envs/

or we can copy to a var first, to use in other commands:

GYM=$(python -c 'import gym; print(gym.__path__[0])')
cp -r gym-super-mario/ppaquette_gym_super_mario ${GYM}/envs/

@HardLu
Copy link

HardLu commented Apr 13, 2018

thanks all of you very much!!! its working now,the first thing to do to resolve this problem is to degrade you gym to 0.9.3 ,and you could import gym.scoreboard then, and then do as what liuny05 said.

@danielcrane
Copy link

danielcrane commented Jun 20, 2018

I tried using an extended version of @Jackiexiao's solution that registers all of the individual stages, found here:

Env: https://gist.github.com/messiest/69569e8151d67c346eb609a0666d43b3
Scoreboard: https://gist.github.com/messiest/36a5cbb35dc57db2e480b4cf300e7223

However, regardless of which stage I try to make (i.e. gym.make('SuperMarioBros-8-2-v0')), it always loads the first stage, 1-1.

Does anyone have any idea what could be causing this?

Thanks!

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

7 participants