-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
[Bug] env.render() giving no/wrong results #2889
Comments
Hello,
This is done on purpose; with the new render API, the method
When you use the new render API, those arguments should be passed to
This is the expected behaviour since the |
My apologies I wasn't following the history #2540 #2671 carefully enough:
Maybe it's too late to argue against the new API, but I don't feel this new API makes sense. To normal users it is an unexpected and surprising breaking change made on minor releases, and fool-proof guards are lacking. This might be just a minority opinion of mine, but I would like to strongly argue that we should allow rendering arguments as in the previous behaviors.
Why? This sounds strange. In which scenario/use cases this would be useful? Is it something really necessary at the cost of breaking backward compatibility and all the existing codes? Is it because one would want to render all the frames when there is frame-skip? If it's needed for some reason, why didn't we have it under a different I can imagine how rendering is done internally, but if you would like to get the frames in the case of frame skips, those should have been available under different APIs (or different names) or use cases, such as using a different render |
Describe the bug
After the merge of new render API #2671 which is not stable yet,
env.render()
giving no results when it is called more than once. Also the rendering result is not correct in terms of type and shape. Please see the example below.Code example
I see three problems here:
im
contains a python list of [480x480x3] ndarray:im[0].shape == (480, 480, 3)
. In our early version of gym,im
itself was a ndarray. I don't think that rendered images contained in a list is correct; and the behavior is different.The width/height parameter
env.render(width=200, height=200)
are ignored; the rendering dimensions are wong.The next call of
env.render()
will give no results: it returns an empty list, i.e.im2 == []
System Info
Additional context
/cc @younik who is the author of #2671.
The text was updated successfully, but these errors were encountered: