Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor and Upgrade to Gymnasium #75

Merged
merged 201 commits into from
Oct 11, 2023
Merged

Refactor and Upgrade to Gymnasium #75

merged 201 commits into from
Oct 11, 2023

Conversation

D-o-d-o-x
Copy link
Collaborator

This PR upgrades fancy_gym from gym to gymnasium and refactors some parts.
This PR replaces #68 and should be merged instead.

Gymnasium is a fork of OpenAIs Gym (v21) by the Farama Foundation, since the original is no longer maintained.
fancy_gym previously used gym v25, the upgrade to Gymnasium v26 brought some breaking changes.

Our new fancy registry allows direct integration into gymnasium's env management; fancy_gym.make is no longer required and gym.make can be used for all our environments and mp-variants instead:
E.g. gym.make(fancy/Reacher5d-v0) or gym.make(fancy_ProDMP/Reacher5d-v0).
We also make all metaworld ML1 tasks avaible under gym.make(metaworld/...) / gym.make(metaworld_ProMP/...) / etc.
Registering mp-variants of environments and MP configuration management has been streamlined (details in the new README, all fancy envs and mp-wrappers were ported over to this new format).

We still fail 12 / 4630 Tests, but these are caused by bugs in other projects and should be fixed there.
These are listed here.

Additional changes:

  • Better README.
  • Switched to newest (as of now) Metaworld version.
  • Switched to new mujoco binding (except when some old OpenAI envs need to be used; old mujoco-py binding is a optional dependency).
  • Rudimentary support for envs, that have a Dict observation space has been added (since this is used by shimmys dm_control bindings).
  • Dependency versions have been made stricter (I had issues with getting tests to pass on some allowed versions).
  • Some of the custom envs still used an old coordinate format (global coordinates), that will no longer supported by future mujoco versions; these were converted to use local coordinates.
  • Now uses shimmy as a compat wrapper for dmc instead of custom one.
  • Since Metaworld now support gymnasium natively, we only have a thin wrapper, to mitigate some issues.
  • Mujoco envs seem to no longer allow supplying a custom XML file, so I build a wrapper, that re-implements this feature for the custom envs.
  • Many custom envs also lacked some metadata and did not expose an observation-space.
  • Fixed some issues with incorrect mp-args (e.g. weights_scale vs weight_scale)

This PR is based on Fabian's '47-update-to-new-gym-api'-branch.

This PR addresses the open issues #47, #62, #34 and PR#71.

Fabian and others added 30 commits October 20, 2022 10:10
In prevous gym versions executing a step returned
obs, reward, done, info = env.step(...)

With the switch to gymnasium this has changed to
obs, reward, terminated, truncated, info = env.step(...)

We also made the code a bit more self explainatory.
pip install .[all] will no longer install components only required for
testing
pip install .[testing] will also install all compionents required to run
all tests
Gymnasium Mujoco Envs no longer allow overriding the used xml_file
We therefore implement intermediate classes, that reimplement this
feature.
fancy_gym/envs/registry.py Outdated Show resolved Hide resolved
fancy_gym/envs/registry.py Outdated Show resolved Hide resolved
fancy_gym/envs/registry.py Outdated Show resolved Hide resolved
fancy_gym/meta/README.MD Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants