Farama-Foundation / Miniworld

Simple and easily configurable 3D FPS-game-like environments for reinforcement learning
http://miniworld.farama.org/
Apache License 2.0
694 stars 129 forks source link

Can we train an agent without opening a window? #26

Closed PrettyMeng closed 4 years ago

PrettyMeng commented 4 years ago

Hi there, is it possible to train an RL agent without opening the simulation window? I'm trying to do training on my server but it can be problematic to open a window there.

Any help or response will be highly appreciated. Thanks!

maximecb commented 4 years ago

Yes, you can train without a window.

Calling env.step() does not open a window.

PrettyMeng commented 4 years ago

Yes, you can train without a window.

Calling env.step() does not open a window.

Thanks for your quick reply! I would like to know does this error occur because of trying to open a window?

pyglet.canvas.xlib.NoSuchDisplayException: Cannot connect to "None"

which is also mentioned in #13 .

maximecb commented 4 years ago

That has to do with trying to connect to a display for rendering. Have you tried using xvfb-run as outlined here?

https://github.com/maximecb/gym-miniworld/blob/master/docs/troubleshooting.md#nosuchdisplayexception-cannot-connect-to-none

PrettyMeng commented 4 years ago

That has to do with trying to connect to a display for rendering. Have you tried using xvfb-run as outlined here?

https://github.com/maximecb/gym-miniworld/blob/master/docs/troubleshooting.md#nosuchdisplayexception-cannot-connect-to-none

Thanks again. Actually the cluster I use cannot install xvfb for some reason. I wonder whether it is possible to do training without displaying or rendering.

maximecb commented 4 years ago

You should contact the cluster administrators and try to get them to install xvfb. It's necessary for many environments that use OpenGL for rendering, unfortunately.

I'm trying to get the people behind the pyglet package to remove this dependency, by implementing EGL support, but that hasn't been moving.

PrettyMeng commented 4 years ago

You should contact the cluster administrators and try to get them to install xvfb. It's necessary for many environments that use OpenGL for rendering, unfortunately.

I'm trying to get the people behind the pyglet package to remove this dependency, by implementing EGL support, but that hasn't been moving.

Thank you so much! I will try.