Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GymEnv should not show a plot when plot=False #31

Closed
ryanjulian opened this issue Mar 28, 2018 · 7 comments
Closed

GymEnv should not show a plot when plot=False #31

ryanjulian opened this issue Mar 28, 2018 · 7 comments
Labels

Comments

@ryanjulian
Copy link
Owner

No description provided.

@zhanpenghe
Copy link
Collaborator

zhanpenghe commented May 1, 2018

I have investigated this before and I think the problem is the video recorder for gym environment.
class GymEnv(Env, Serializable): def __init__(self, env_name, record_video=True, video_schedule=None, log_dir=None, record_log=True,

A quick fix could be setting the default value of record_video to False and the plot will not show up.
I am not sure if tensoflow allows recording video without rendering .

@ryanjulian
Copy link
Owner Author

Hmm sounds good. I think we should preserve the invariant that record_video=True will successfully record a video (even if that means ignoring plot=False). The ideal is for gym to record off-screen, but I'm not sure that's supported.

@ryanjulian ryanjulian added the bug label May 15, 2018
@ryanjulian ryanjulian modified the milestones: Week of May 10, Week of May 14, Week of May 21 May 15, 2018
@jonashen
Copy link
Collaborator

I have determined that it is impossible for gym to record off-screen, because the downloaded video is built from a series of static RGB frames, and it retrieves these frames through frame = self.env.render(...), and gym's core render function by default must draw out the window in order to capture the RGB frame through internal screen capture.

In short, plot=False cannot produce a recorded video. How should we proceed?

@ryanjulian
Copy link
Owner Author

I think it's fine to require plot=True to guarantee recording.

@ryanjulian ryanjulian removed this from the Week of May 21 milestone May 29, 2018
@jonashen
Copy link
Collaborator

When plot=False, it will still display the window as well as record. Should we leave that as well, or simply turn off window display (and thus also turn off recording)?

@ryanjulian
Copy link
Owner Author

IMO the correct behavior is to turn off recording when plot=False. It should probably be an enum option rather than 2 booleans which interact, but c'est la vie.

We will have another opportunity to address this when we replace rllab.Env with gym.Env.

@ryanjulian
Copy link
Owner Author

See rlworkgroup/garage#43

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants