我试图在 Google Compute Engine VM 上运行 CartPole-v0 示例。https://gym.openai.com/docs https://gym.openai.com/docs
import gym
env = gym.make('CartPole-v0')
env.reset()
for _ in range(1000):
env.render()
env.step(env.action_space.sample()) # take a random action
我安装了 XQuartz,并使用 -X 进行 ssh。
首先,我得到
pyglet.canvas.xlib.NoSuchDisplayException:无法连接到“None”
然后根据http://www.gitterforum.com/discussion/openai-gym?page=28 http://www.gitterforum.com/discussion/openai-gym?page=28,我使用“xvfb-run -s”-screen 0 1400x900x24“/bin/bash”
然后运行良好,结果如下:
Making new env: CartPole-v0
You are calling 'step()' even though this environment has already returned done = True. You should always call 'reset()' once you receive 'done = True' -- any further steps are undefined behavior
但什么也没有渲染...
使用观察部分中的代码https://gym.openai.com/docs https://gym.openai.com/docs.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)