PacktPublishing / Hands-On-Reinforcement-Learning-with-Python

Hands-On Reinforcement Learning with Python, published by Packt
MIT License
769 stars 331 forks source link

Building a Video Game Bot using OpenAI Universe -Error #2

Open ZaremaSokhova opened 4 years ago

ZaremaSokhova commented 4 years ago

Hello! I'm reading a book now.

I try to run the tasks that are given in the second chapter. The task where the robot learns to walk turned out to run, it works.

But when launching a program with a bot for the video game "Auto-Racing", an error occurs:


KeyError: 'flashgames.NeonRace-v0'

During handling of the above exception, another exception occurred:

UnregisteredEnv Traceback (most recent call last)

in 3 import random 4 ----> 5 env = gym.make('flashgames.NeonRace-v0') 6 env.configure(remotes = 1) # автоматически создает локальный контейнер docker 7 observation_n = env.reset() /opt/anaconda3/envs/universe/lib/python3.6/site-packages/gym/envs/registration.py in make(id, **kwargs) 140 141 def make(id, **kwargs): --> 142 return registry.make(id, **kwargs) 143 144 def spec(id): /opt/anaconda3/envs/universe/lib/python3.6/site-packages/gym/envs/registration.py in make(self, path, **kwargs) 84 else: 85 logger.info('Making new env: %s', path) ---> 86 spec = self.spec(path) 87 env = spec.make(**kwargs) 88 # We used to have people override _reset/_step rather than /opt/anaconda3/envs/universe/lib/python3.6/site-packages/gym/envs/registration.py in spec(self, path) 126 raise error.DeprecatedEnv('Env {} not found (valid versions include {})'.format(id, matching_envs)) 127 else: --> 128 raise error.UnregisteredEnv('No registered env with id: {}'.format(id)) 129 130 def register(self, id, **kwargs): UnregisteredEnv: No registered env with id: flashgames.NeonRace-v0 ------------------------------------------------------------------------- When installing, I had a problem related to mujoco-py. Could the fact that the program does not start be related to this? Installed OpenAi on a macbook with MacOS Catalina ver. 10.15.2. I will be grateful for the help.
sujitpal commented 3 years ago

Not the author, but the error message seems to indicate that the "flashgames.NeonRace-v0" is not installed. It is possible that there is a typo in the name. You can list all your environments with the following code snippet, that might help debugging this further.

from gym import envs
for e in envs.registry.all():
    print(e)