llSourcell / OpenAI_Game_Bot_Live_stream

This is the code for the "How to Install OpenAI's Universe and Make a Game Bot" live session by Siraj Raval on Youtube
39 stars 36 forks source link

AttributeError: 'VNCEnv' object has no attribute 'remote_manager' #6

Open mawesome4ever opened 7 years ago

mawesome4ever commented 7 years ago

So i downloaded your folder and ran it immediately i then got the AttributeError, not sure how to fix it since the error is coming from the universe module(?), any ideas?

Here is the output:

mawesome-mac:OpenAI_Game_Bot_Live_stream-master mawesome$ python3 demo.py
[2017-08-04 01:47:57,355] Making new env: flashgames.CoasterRacer-v0
Traceback (most recent call last):
  File "demo.py", line 93, in <module>
    main()  
  File "demo.py", line 39, in main
    observation_n = env.reset()
  File "/Users/mawesome/Downloads/OpenAI_Game_Bot_Live_stream-master/gym/core.py", line 104, in reset
    return self._reset()
  File "/Users/mawesome/Downloads/OpenAI_Game_Bot_Live_stream-master/universe/wrappers/timer.py", line 18, in _reset
    return self.env.reset()
  File "/Users/mawesome/Downloads/OpenAI_Game_Bot_Live_stream-master/gym/core.py", line 104, in reset
    return self._reset()
  File "/Users/mawesome/Downloads/OpenAI_Game_Bot_Live_stream-master/universe/wrappers/render.py", line 28, in _reset
    observation_n = self.env.reset()
  File "/Users/mawesome/Downloads/OpenAI_Game_Bot_Live_stream-master/gym/core.py", line 104, in reset
    return self._reset()
  File "/Users/mawesome/Downloads/OpenAI_Game_Bot_Live_stream-master/universe/wrappers/throttle.py", line 42, in _reset
    observation = self.env.reset()
  File "/Users/mawesome/Downloads/OpenAI_Game_Bot_Live_stream-master/gym/core.py", line 104, in reset
    return self._reset()
  File "/Users/mawesome/Downloads/OpenAI_Game_Bot_Live_stream-master/universe/envs/vnc_env.py", line 336, in _reset
    self._handle_connect()
  File "/Users/mawesome/Downloads/OpenAI_Game_Bot_Live_stream-master/universe/envs/vnc_env.py", line 510, in _handle_connect
    for remote in self.remote_manager.pop(n=n):
AttributeError: 'VNCEnv' object has no attribute 'remote_manager'
mawesome-mac:OpenAI_Game_Bot_Live_stream-master mawesome$ 
BarretoJacob commented 7 years ago

I am also getting this error. [2017-08-20 16:29:46,022] Making new env: flashgames.CoasterRacer-v0 Traceback (most recent call last): File "demo.py", line 93, in <module> main() File "demo.py", line 39, in main observation_n = env.reset() File "/home/jacobtyler/anaconda3/lib/python3.6/site-packages/gym/core.py", line 104, in reset return self._reset() File "/home/jacobtyler/universe/universe/wrappers/timer.py", line 18, in _reset return self.env.reset() File "/home/jacobtyler/anaconda3/lib/python3.6/site-packages/gym/core.py", line 104, in reset return self._reset() File "/home/jacobtyler/universe/universe/wrappers/render.py", line 28, in _reset observation_n = self.env.reset() File "/home/jacobtyler/anaconda3/lib/python3.6/site-packages/gym/core.py", line 104, in reset return self._reset() File "/home/jacobtyler/universe/universe/wrappers/throttle.py", line 42, in _reset observation = self.env.reset() File "/home/jacobtyler/anaconda3/lib/python3.6/site-packages/gym/core.py", line 104, in reset return self._reset() File "/home/jacobtyler/universe/universe/envs/vnc_env.py", line 336, in _reset self._handle_connect() File "/home/jacobtyler/universe/universe/envs/vnc_env.py", line 510, in _handle_connect for remote in self.remote_manager.pop(n=n): AttributeError: 'VNCEnv' object has no attribute 'remote_manager'

Ben0p commented 7 years ago

You have to configure the environment before using it. See https://github.com/openai/universe#breaking-down-the-example. For your code, add env.configure(remotes=1) after line 35.

Worked for me, thanks to tlbtlbtlb: https://github.com/openai/universe/issues/129

cooperra and rahuldeo2047 have pull requests for this.

AloshkaD commented 6 years ago

Add the following line

env.configure(remotes=1)