openai / gym

A toolkit for developing and comparing reinforcement learning algorithms.
https://www.gymlibrary.dev
Other
34.5k stars 8.59k forks source link

Can I run Open-AI in cloud9?(ipython notebook #152

Closed darren1231 closed 8 years ago

darren1231 commented 8 years ago

image

I tried to used ipython notebook to run Open-AI in cloud9. But it seems that render returned nothing. Is that normal?

jietang commented 8 years ago

close=True will close the viewer. Can you try running env.render(mode='rgb_array')?

darren1231 commented 8 years ago

No, it created a a lot of words and said error. image image

jietang commented 8 years ago

I suspect that the pyglet-based rendering we use cannot handle rendering inside the notebook (in the stack trace you can see it trying to open an xlib.XOpenDisplay and failing). We're unlikely to support this at present but could add it depending on demand.

As an experiment to verify that gym is working properly, you can try running on the FrozenLake-v0 environment - it should render to stdout (if you use the default 'human' mode) or a StringIO (if you use the 'ansi' mode)

gdb commented 8 years ago

(Also relevant: https://github.com/openai/gym/issues/56.)

darren1231 commented 8 years ago

Thank you all guys. I have found another method. Because cloud9[https://c9.io/?redirect=0] is similiar to docker which is a virtual machine. So I have to run next line. Xvfb :12 -screen 0 800x600x24 +extension RANDR 2>/dev/null & export DISPLAY=:12 Then run the code. It worked, but it can only produce picture without showing the screen. Now I just have to combine them into gif then I can watch the movie!!!~~

jietang commented 8 years ago

Glad you got to the bottom of it.

Faur commented 7 years ago

Can you elaborate on your solution? I am having a very similar problem.

I am using jupyter on a AWS server. I get the following error

GLXInfoException: pyglet requires an X server with GLX

I don't really care how I see the rendering, something like img = env.render(mode='rgb_array', close=True) was also my first bet, but img is just empty.

Faur commented 7 years ago

It seems that this is solved in #247 now