本文介绍了使用Google Computing Engine运行OpenAI Gym的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在Google Compute Engine VM上运行CartPole-v0示例. https://gym.openai.com/docs

I was trying to run the CartPole-v0 example on a Google Compute Engine VM.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.

I have XQuartz installed, and ssh with -X.

首先,我得到了pyglet.canvas.xlib.NoSuchDisplayException:无法连接到无"

First, I was gettingpyglet.canvas.xlib.NoSuchDisplayException: Cannot connect to "None"

然后根据 http://www.gitterforum.com/discussion/openai -gym?page = 28 ,我使用的是"xvfb-run -s" -screen 0 1400x900x24"/bin/bash"

Then according to http://www.gitterforum.com/discussion/openai-gym?page=28, I use "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 .

这篇关于使用Google Computing Engine运行OpenAI Gym的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-07 18:31