0

当我尝试从此处运行以下示例代码时,Python 无法找到该remote_manager属性。我已经安装了所有必需的软件包,并且OpenAI 健身房示例似乎可以正常工作。

我在 Linux Mint 18 下运行 Python 3.5,并从 pip 存储库中获得了 OpenAI Gym 和 Universe。

import gym
import universe # register Universe environments into Gym

env = gym.make('flashgames.DuskDrive-v0') # any Universe environment ID here
observation_n = env.reset()

while True:
  # agent which presses the Up arrow 60 times per second
  action_n = [[('KeyEvent', 'ArrowUp', True)] for _ in observation_n]
  observation_n, reward_n, done_n, info = env.step(action_n)
  env.render()

完整的堆栈跟踪是

[2017-01-25 14:04:05,416] Making new env: flashgames.DuskDrive-v0
Traceback (most recent call last):
  File "/home/mark/projects/development-playground/src/utils/openai_experiments.py", line 5, in <module>
observation_n = env.reset()
  File "/usr/local/lib/python3.5/dist-packages/gym/core.py", line 123, in reset
observation = self._reset()
  File "/usr/local/lib/python3.5/dist-packages/universe/wrappers/timer.py", line 15, in _reset
return self.env.reset()
  File "/usr/local/lib/python3.5/dist-packages/gym/core.py", line 123, in reset
observation = self._reset()
  File "/usr/local/lib/python3.5/dist-packages/universe/wrappers/render.py", line 25, in _reset
observation_n = self.env.reset()
  File "/usr/local/lib/python3.5/dist-packages/gym/core.py", line 123, in reset
observation = self._reset()
  File "/usr/local/lib/python3.5/dist-packages/universe/wrappers/throttle.py", line 42, in _reset
observation = self.env.reset()
  File "/usr/local/lib/python3.5/dist-packages/gym/core.py", line 123, in reset
observation = self._reset()
  File "/usr/local/lib/python3.5/dist-packages/universe/envs/vnc_env.py", line 331, in _reset
self._handle_connect()
  File "/usr/local/lib/python3.5/dist-packages/universe/envs/vnc_env.py", line 498, in _handle_connect
for remote in self.remote_manager.pop(n=n):
AttributeError: 'VNCEnv' object has no attribute 'remote_manager'
4

1 回答 1

4

你忘了打电话 env.configure()

env = gym.make('flashgames.DuskDrive-v0')
env.configure(remotes=1)
observation_n = env.reset()
于 2017-01-26T02:31:05.017 回答