-
Notifications
You must be signed in to change notification settings - Fork 1.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
check_env warning for FrameStacked observation in stable_baselines3.common.env_checker #1500
Comments
Thank you for reporting. I agree that it shouldn't trigger a warning. I think we should replace However we should first check that it doesn't break anything. |
Do you think I could try to fix it ? (even if I never did open source yet) |
It's time to get started! First, read the contribution guidelines, fork the repo, make your changes and open a pull request. As a new, novice contributor, I'm curious to know what difficulties you had in this process. If you don't mind, I'd like you to compile a note of the points that gave you a hard time. (Something quite raw, to understand where are the points that are not directly crystal clear.) You can then share this note in a new issue when we've finished. This could help to improve support for new contributors. |
Before opening a pull request I had a question. Indeed the solution you proposed worked for this problem with Box and Dict observations (the 2 authorized observation spaces for FrameStack : https://gymnasium.farama.org/api/wrappers/observation_wrappers/#gymnasium.wrappers.FrameStack), but I still get 2 warnings and I don't know if it is the result you expected : /home/flowers/Desktop/python/stable-baselines3/stable_baselines3/common/env_checker.py:238: UserWarning: Your observation has an unconventional shape (neither an image, nor a 1D vector). We recommend you to flatten the observation to have only a 1D vector or use a custom policy to properly process the data. The first warning is logical because indeed the observation won't be an image or a 1D vector after FrameStack. The second one doesn't seem critical either and depends of gymnasium but I was wondering if you knew a way not to trigger this warning. And sure for the note if it can help others ! But I should maybe try to do more contributions before doing it, because you already gave me the solution here ! |
🐛 Bug
When using the "check_env "function of "stable_baselines3.common.env_checker" with an environment wrapped in a "FrameStack" wrapper from "gymnasium.wrappers", I get an error on the type of observation returned.
Indeed, the observation has a <class 'gymnasium.wrappers.frame_stack.LazyFrames'> instead of a np.array type (which is normal because it is indicated in the gymnasium documentation).
But then I can still use this environment with FrameStacked observation to train an agent. I know it is not critical but is this normal that the check_env warns about a problem while the environment can still be used to train agents with stable_baselines3 algorithms?
To Reproduce
Relevant log output / Error message
System Info
I am using these versions :
Checklist
The text was updated successfully, but these errors were encountered: