openai / gym

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

Present way of returning rgb array, removed close=True. #1004

Closed mchalecki closed 5 years ago

mchalecki commented 6 years ago

In release v0.9.6 argument close in render method was removed. What's the current way of returning rgb array. In basic enviroments for example Mountain car:

import gym

env = gym.make('MountainCar-v0')
    env.reset()
    while 1:
        env.step(env.action_space.sample())
        obs = env.render(mode='rgb_array')
    env.close()

The array is returned correctly but the window is still appearing. This code will run server-side so I only need an array to pass on.

carlosgmartin commented 6 years ago

I'm having the same issue. How can we render to an array without opening a window?

christopherhesse commented 5 years ago

It's possible to do it without creating a visible window, but but until pyglet supports EGL rendering, this will still require an X11 server on linux. Is the problem that the window is visible or that there is a window at all?

christopherhesse commented 5 years ago

Closing due to lack of activity.