gym-electric-motor icon indicating copy to clipboard operation
gym-electric-motor copied to clipboard

incompatibility with gym >0.24.0

Open atra94 opened this issue 2 years ago • 5 comments

OpenAI has released new versions 0.24.0 and 0.24.1 of gym recently.

One new feature is a "PassiveEnvChecker" that checks multiple environment properties (e.g. action-space, observation-space etc.)

There seems to be a bug (in gym) when checking for our tuple-observation spaces. Therefore, GEM is currently incompatible with every gym-version from 0.24.0 on.

I will investigate this error more in depth and post also an issue to the gym-repo if the bug is really in the gym-code.

atra94 avatar Jun 08 '22 20:06 atra94

Hey, Im from the gym dev team. In v24, there was a number of bugs in the passive environment checker. In v25, all of these bugs are fixed, could you check that this doesn't cause unexpected results

To test you can run gym.utils.env_checker.check_env

pseudo-rnd-thoughts avatar Aug 20 '22 18:08 pseudo-rnd-thoughts

I just saw https://github.com/upb-lea/gym-electric-motor/issues/183 as well. If you need any help updating to the new API, there is a number of changes in v25 and v26 (in the future). Join the gym discord server (https://discord.gg/nHg2JRN489) and contact myself (Pseudo-Rnd)

pseudo-rnd-thoughts avatar Aug 20 '22 18:08 pseudo-rnd-thoughts

Is there some exact plans to upgrade gym version?

PaParaZz1 avatar Sep 13 '22 11:09 PaParaZz1

We have this issue on our backlog, and we will fix it in near future

wkirgsn avatar Sep 17 '22 16:09 wkirgsn

We have this issue on our backlog, and we will fix it in near future

Thank you! I am the developer of DI-engine, looking for some interesting applications to apply advanced DRL algorithms and collect meaningful demonstrations. Are you willing to develop more examples and benchmark results abour your repo together, or any other ideas?

PaParaZz1 avatar Sep 18 '22 08:09 PaParaZz1

>>> env_checker.check_env(gem.make("Cont-CC-SCIM-v0"))

AssertionError: The obs returned by the `reset()` method length is not same
 as the observation space length, obs length: 14, space length: 2

gym-0.26.2 and gym-electric-motor-1.1.0

wkirgsn avatar Dec 20 '22 16:12 wkirgsn

In Gym v0.26, there was a large number of changes to the API - https://gymnasium.farama.org/content/migration-guide/ In reset, the return type expected is a tuple of the observation and info. As this environment has a tuple with length 2, then it passed the first check but failed the second that the observation is contained within the observation space. You need to modify the reset and step functions to match gym v0.26 API

pseudo-rnd-thoughts avatar Dec 20 '22 18:12 pseudo-rnd-thoughts

thanks for the hint, I will look into it

wkirgsn avatar Dec 21 '22 13:12 wkirgsn

gymnasium API was adopted in GEM v.2.0.0

wkirgsn avatar Aug 15 '23 09:08 wkirgsn