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

[Feature Request] Support for Gym(nasium) v0.22+ #871

Closed
chrisyeh96 opened this issue Apr 19, 2022 · 8 comments · Fixed by #1327
Closed

[Feature Request] Support for Gym(nasium) v0.22+ #871

chrisyeh96 opened this issue Apr 19, 2022 · 8 comments · Fixed by #1327
Labels
duplicate This issue or pull request already exists enhancement New feature or request

Comments

@chrisyeh96
Copy link

Is there any estimated timeline for when OpenAI Gym v0.22+ will be supported?

gym v0.22 was understandably a large breaking change, but it would be great to know when SB3 might start supporting it.

@chrisyeh96 chrisyeh96 added the enhancement New feature or request label Apr 19, 2022
@araffin araffin added the duplicate This issue or pull request already exists label Apr 19, 2022
@araffin
Copy link
Member

araffin commented Apr 19, 2022

See PR #780

duplicate of #840

PS: if you want faster support, we need help to update our notebooks/tutorials

@araffin araffin closed this as completed Apr 19, 2022
@araffin araffin mentioned this issue Apr 19, 2022
19 tasks
@araffin araffin pinned this issue Aug 23, 2022
@araffin araffin reopened this Oct 24, 2022
@araffin araffin changed the title [Feature Request] Support for OpenAI Gym v0.22+ [Feature Request] Support for Gym(nasium) v0.22+ Nov 16, 2022
@araffin araffin mentioned this issue Feb 11, 2023
20 tasks
@araffin
Copy link
Member

araffin commented Feb 13, 2023

Gymnasium support (by default) is here: #1327
With support for gym 0.21/0.26 and gymnasium env.

@araffin
Copy link
Member

araffin commented Mar 29, 2023

I just released an alpha version of the Gymnasium branch on PyPi:

# sb3 contrib installs sb3 too
pip install "sb3_contrib>=2.0.0a1" --upgrade

Documentation is available here: https://stable-baselines3.readthedocs.io/en/feat-gymnasium-support/

@ReHoss
Copy link
Contributor

ReHoss commented May 17, 2023

Hi @araffin ,

First thank everyone for the update to Gymnasium!

Could you or someone provide a shortlist of fixes to apply to our Gym 0.21 custom environments in order to keep reproducibility in the context of sb3 ?

Thank you for your consideration,
Best,

@araffin
Copy link
Member

araffin commented May 17, 2023

Could you or someone provide a shortlist of fixes to apply to our Gym 0.21 custom environments in order to keep reproducibility in the context of sb3 ?

What do you mean exactly?
You want to keep using gym 0.21 or you want to upgrade to gymnasium and get the exact same results with SB3 as before when using the same setup (same machine, same os, same virtual env, same random seed)?

@ReHoss
Copy link
Contributor

ReHoss commented May 17, 2023

Could you or someone provide a shortlist of fixes to apply to our Gym 0.21 custom environments in order to keep reproducibility in the context of sb3 ?

What do you mean exactly? You want to keep using gym 0.21 or you want to upgrade to gymnasium and get the exact same results with SB3 as before when using the same setup (same machine, same os, same virtual env, same random seed)?

Yes I exactly want to upgrade to Gymnsasium while keeping same results when using same setup. I am just wondering if 0.21 custom envs adapt directly to 0.28 or do I need to fix some things?

@araffin
Copy link
Member

araffin commented May 17, 2023

I am just wondering if 0.21 custom envs adapt directly to 0.28 or do I need to fix some things?

It might work out of the box (and you will need #1486, we are missing reviewers for that PR) but I would say there are no warranty as Gymnasium changed a lot of things internally and might require a newer version of numpy.

As written in the documentation, we can only guaranty exact reproducibility for a given SB3/gym version.
However, performance should be the same (when comparing quantitative evaluations).

@ReHoss
Copy link
Contributor

ReHoss commented May 17, 2023

I am just wondering if 0.21 custom envs adapt directly to 0.28 or do I need to fix some things?

It might work out of the box (and you will need #1486, we are missing reviewers for that PR) but I would say there are no warranty as Gymnasium changed a lot of things internally and might require a newer version of numpy.

As written in the documentation, we can only guaranty exact reproducibility for a given SB3/gym version. However, performance should be the same (when comparing quantitative evaluations).

Thanks, I'll provide some feedback at some point.

EDIT:

@araffin araffin unpinned this issue Jun 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants