openai / gym

A toolkit for developing and comparing reinforcement learning algorithms.
https://www.gymlibrary.dev
Other
34.49k stars 8.59k forks source link

[Bug Report] Undue UserWarning: We recommend you to use a symmetric and normalized Box action space (range=[-1, 1]) #2885

Closed qgallouedec closed 2 years ago

qgallouedec commented 2 years ago

It seems like there is an inversion in the gym.utils.env_checker.check_env function: observation space is checked with check_action_space

https://github.com/openai/gym/blob/053ee809324861dc1bec19feee97b47ba1557a94/gym/utils/env_checker.py#L237

and action space is checked with check_observation_space

https://github.com/openai/gym/blob/053ee809324861dc1bec19feee97b47ba1557a94/gym/utils/env_checker.py#L233

causing undue warnings such as

UserWarning: WARN: We recommend you to use a symmetric and normalized Box action space (range=[-1, 1])

Checklist

pseudo-rnd-thoughts commented 2 years ago

Wow, thanks for spotting that. That is impressive that I messed that up. As I have done a number of upgrades / bug fixes to the environment checker, then I have added it to that PR https://github.com/openai/gym/pull/2873

pseudo-rnd-thoughts commented 2 years ago

@qgallouedec Would you be able to close your PR for this #2886 and clone my PR to check that it runs against your environments to make sure it doesn't raise any incorrect error?

qgallouedec commented 2 years ago

Fixed in cdeedd8e3ba454c48af2760bc26b70866e2d7141