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
Added render() to gym.vector environments #1624
Conversation
One minor thing that I've run into before, is that, it might be better for This PR also adds Thanks for the PR, I think having render on here makes a lot of sense, but I'd like to potentially avoid some unnecessary complexity from the baselines setup if possible and keeping the size of the interface small is very helpful for that. Right now it's the rather large gym.Env interface + |
Thanks for the response! Being able to render from a vectorized set of environments is something I found useful for debugging. If it's just a matter of API design, I can make some changes to simplify it. Would that be okay? :) |
@jkterry1 I think this is a good feature in general but the implementation is possibly problematic as it assumes that all environments can be rendered using the following code, which appears to be environment specific:
Some environments return images in the form A possible solution is a generic fast (like pyglet) renderer for RGB images that can be configured to Another potential issue is that in some cases people will run a VecEnv with a large number of environments, and a call to "render" will be super slow, so maybe we need a max number of environments to tile. Finally, I agree with @christopherhesse in that the two |
Thanks a ton @Bam4d. In that case I'm going to close this and we can revisit it after the planned breaking changes to vector environments are made. |
Hey re-opening this issue. @Bam4d raises a good point that it makes certain assumptions on how the env could be rendered, but I feel this is an acceptable downside. The main thing for me is the speed implication of rendering lots of envs at once, which is not friendly to throughput and memory. Maybe we can address this with an argument like |
This PR adds rendering capability to vectorized environments (
gym.vector
) viaenv.render()
, where the rendered images are tiled to be shown in a single window (the same as in baseline).