Inompatible return format; gym's Env.reset method when using custom env. with non (2,) dimensions for the observation space. #1694
Labels
check the checklist
You have checked the required items in the checklist but you didn't do what is written...
custom gym env
Issue related to Custom Gym Env
duplicate
This issue or pull request already exists
🐛 Bug
There seems to be an incompatibility in the expected gym's Env.reset return format, when using a custom environment. Note this problem only occurs when using a custom observation space of non (2,) dimension.
See the code example, which provides two different Env.reset return formats, one which is the required one according to the gymnasium. documentation (i.e. the format is equal to return in the
step
method), and results in an error during model training step (see stracktrace, error below ..Format A
; and an adjusted with which we can succesfully complete the training, but then get an error during the model prediction (see stractrace, error below ..Format B
).I'm able to work around the problem by making the following adjustements in the stable_baselines3, file
common/vec_env/dummy_vec_env.py
, and using My.reset method format A.With the adjustements above I can succesfully perfom model training and predictions. This doesn't seem to be a feasible long-term solution though, as there is a deeper underlying problem which needs to be fixed.
Code example
Relevant log output / Error message
System Info
Libraries are installed with poetry, from the following
pyproject.toml
configuration:Checklist
The text was updated successfully, but these errors were encountered: