Metaworld
Metaworld copied to clipboard
Dtype of observation space does not match returned observation
Currently, the observation space does not specify a dtype, which means it defaults to float32, however the returned numpy array is by default in float64. This will lead to exceptions with more recent versions of gym as they introduced explicit checks if the returned observations are contained in the observation space.
Hence, I propose to either add the dtype to the Box space constructor https://github.com/rlworkgroup/metaworld/blob/18118a28c06893da0f363786696cc792457b062b/metaworld/envs/mujoco/sawyer_xyz/sawyer_xyz_env.py#L385-L403
and/or cast the returned values from step()
and reset()
to the appropriate dtype.
The same thing should probably be done for the action space as well https://github.com/rlworkgroup/metaworld/blob/18118a28c06893da0f363786696cc792457b062b/metaworld/envs/mujoco/sawyer_xyz/sawyer_xyz_env.py#L128-L131