Skip to content

Update Gym to Gymnasium #6166

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

Open
wants to merge 16 commits into
base: develop
Choose a base branch
from

Conversation

Zach-Attach
Copy link

@Zach-Attach Zach-Attach commented Oct 30, 2024

Proposed change(s)

  • Updated requirement from gym 0.21 to the latest version of gymnasium
    • version currently not specified but can be for safety
  • Updated pettingzoo requirement to be compatible with latest version
    • set to 1.22.0 or greater (versions that use gymnasium)
  • Replaced all gym imports to gymnasium
  • Updated step and reset functions in UnityToGymWrapper and UnityParallelEnv to align with Gymnasium expectations (see https://github.com/Farama-Foundation/Gymnasium/blob/main/docs/introduction/migration_guide.md for details)
    • UnityAECEnv stays the same
  • Updated tests to use gymnasium and expect new step and reset functions
  • Updated documentation to no longer refer to OpenAI Gym and now refer to Farama Foundation's Gymnasium

Useful links (Github issues, JIRA tickets, ML-Agents forum threads etc.)

There is 1 open PR and 4 issues related to this addition:

Types of change(s)

  • Bug fix
  • New feature
  • Code refactor
  • Breaking change
  • Documentation update
  • Other (please describe)

Checklist

  • Added tests that prove my fix is effective or that my feature works
  • Updated the changelog (if applicable)
  • Updated the documentation (if applicable)
  • Updated the migration guide (if applicable)

Other comments

  • I do not use pettingzoo or the premade environments much myself, so there may be additional fixes that are needed.
  • I was unsure if I was expected to add to the changelog or migration guide since this is not an actual release, but am happy to contribute.
  • This change may result in the possibility of upgrading the maximum version other dependencies (grpcio, protobuf, numpy) as well, potentially adding support for python 3.11 or newer.

@CLAassistant
Copy link

CLAassistant commented Oct 30, 2024

CLA assistant check
All committers have signed the CLA.

@paulo101977
Copy link

I looked at the code. Everything is ok to release, I don't understand why they didn't approve it...

@Zach-Attach
Copy link
Author

Not sure. I also have code to update PettingZoo to a version working with Gymnasium here but given that it includes other fixes to Zoo and the silence on this PR, I haven't tried integrating in here.

@Zach-Attach
Copy link
Author

@maryamziaa @alexander-suvorov I decided to add the anticipated pettingzoo changes to this PR since it hasn't gotten much attention. This should resolve any issues that might directly result from use of this code.

In addition, there are also issues with uint8 visuals but I have withheld those here as they are a really more of a separate issue. Please let me know if there's anything I can do to help move this issue forward. I have been using this code across single vector, multi vector, and pettingzoo environments without issue for nearly a year now without issue (aside from uint8 visuals which would need a separate PR).

@maryamziaa
Copy link
Contributor

@maryamziaa @alexander-suvorov I decided to add the anticipated pettingzoo changes to this PR since it hasn't gotten much attention. This should resolve any issues that might directly result from use of this code.

In addition, there are also issues with uint8 visuals but I have withheld those here as they are a really more of a separate issue. Please let me know if there's anything I can do to help move this issue forward. I have been using this code across single vector, multi vector, and pettingzoo environments without issue for nearly a year now without issue (aside from uint8 visuals which would need a separate PR).

Hey, thanks for putting this PR together! Unfortunately, we haven’t been able to review PRs or community contributions lately since ML-Agents was in maintenance mode. The good news is we’ve started ramping back up and getting things back up to speed again. Alex and I will take a look at your PR soon, but it might not be right away, sorry! But fear not, it’s definitely on my list.

@Zach-Attach
Copy link
Author

@maryamziaa Thanks for the update. Glad to hear! The lack of gymnasium support in the official pip package has been a major roadblock in use since git branches as dependencies are not allowed in published pip packages.
Hope to hear more soon.

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.

4 participants