Comments (6)
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)
from gym-super-mario.
@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.
from gym-super-mario.
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/
from gym-super-mario.
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.
from gym-super-mario.
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.
from gym-super-mario.
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!
from gym-super-mario.
Related Issues (20)
- Error UnregisteredEnv('No registered env with id: {}'.format(id)) HOT 1
- Env fails when creating temp lua file
- Emulator freeze HOT 2
- How about adding a function to move mario to a specified position?
- Training time of openai gym is too long, what is the good way to accelerate it? HOT 2
- How train Mario game with OpenAI gym in the cloud, and download this agent, and run this agent on myself computer ? HOT 3
- Modifications required to fit latest gym version HOT 4
- gym (0.9.3),,ImportError: No module named client, from gym.scoreboard.client HOT 5
- will it compatable gym latest version? HOT 1
- Install Without `gym-pull` HOT 3
- Mario Distance HOT 1
- NotImplementedError HOT 1
- Type Error 'int object is not subscriptable' HOT 1
- AttributeError: 'MetaSuperMarioBrosEnv' object has no attribute 'disable_out_pipe'
- Unusually large reward on first step
- Run on windows HOT 1
- Action Space doesn't allow sampling for random starts
- Error in gym-super-mario-bros package
- Only returning pixel data not Tile Data
- Cannot disable GUI for FCEUX HOT 19
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gym-super-mario.