Closed jamesmr13 closed 1 year ago
observation outputis:[{'observation': array([ 3.8439669e-02, -2.1944723e-12, 1.9740014e-01, 0.0000000e+00, -0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 7.5348794e-02, 9.0728514e-02, 2.0000000e-02, 0.0000000e+00, -0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00], dtype=float32), 'achieved_goal': array([0.07534879, 0.09072851, 0.02 ], dtype=float32), 'desired_goal': array([-0.00748878, 0.07134774, 0.1988182 ], dtype=float32)} {'is_success': array(False)}]
obeservation.spaces.items() output is: odict_items([('achieved_goal', Box(-10.0, 10.0, (3,), float32)), ('desired_goal', Box(-10.0, 10.0, (3,), float32)), ('observation', Box(-10.0, 10.0, (19,), float32))])
so you can try this:
for key, subspace in observation_space.spaces.items():
obs = observation[0][key]
if obs.shape != subspace.shape:
all_non_vectorized = False
break
🐛 Bug
My specs:
Windows Python 3.11
Stable_baselines3
Gymnasium
I am using a custom gym environment with a Dict observation space shown here
After I have the model learn I want to test it on the environment in a pygame rendering mode code for that is here:
My learn method seemingly functions normally as this is the output from 1024 timesteps prior to the error being thrown.
I get the same error with trying to call predict on the SimpleMultiObsEnv provided by stable_baselines3 so I have put that code for the minimal example to reproduce the bug.
Code example
Relevant log output / Error message
System Info
No response
Checklist