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

Add Gymnasium support #1327

Merged
merged 257 commits into from
Apr 14, 2023
Merged

Add Gymnasium support #1327

merged 257 commits into from
Apr 14, 2023

Conversation

araffin
Copy link
Member

@araffin araffin commented Feb 11, 2023

Description

Like #780 but with gymnasium as default and compat wrapper on (would close #871 too).

Installation:

pip install git+https://github.com/DLR-RM/stable-baselines3@feat/gymnasium-support
pip install git+https://github.com/Stable-Baselines-Team/stable-baselines3-contrib@feat/gymnasium-support

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

There is an alpha version on pypi:

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

Some new issues:

Missing:

  • update changelog
  • update notebooks (rename imports as they should already work with this version)
  • update tutorials
  • Cleanup GymStep26Return

Related but due to pygame: pygame/pygame#3572

Motivation and Context

  • I have raised an issue to propose this change (required for new features and bug fixes)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (update in the documentation)

closes #840 #871
closes #271
closes #1156
closes #1324
closes #1406
closes #1315

Checklist

  • I've read the CONTRIBUTION guide (required)
  • I have updated the changelog accordingly (required).
  • My change requires a change to the documentation.
  • I have updated the tests accordingly (required for a bug fix or a new feature).
  • I have updated the documentation accordingly.
  • I have opened an associated PR on the SB3-Contrib repository (if necessary)
  • I have opened an associated PR on the RL-Zoo3 repository (if necessary)
  • I have reformatted the code using make format (required)
  • I have checked the codestyle using make check-codestyle and make lint (required)
  • I have ensured make pytest and make type both pass. (required)
  • I have checked that the documentation builds using make doc (required)

Note: You can run most of the checks using make commit-checks.

Note: we are using a maximum length of 127 characters per line

* Fix SAC type hints, improve DQN ones

* Fix A2C and TD3 type hints

* Fix PPO type hints

* Fix on-policy type hints

* Fix base class type annotation, do not use defaults

* Update version
@araffin araffin mentioned this pull request Apr 13, 2023
14 tasks
@araffin araffin merged commit 40e0b9d into master Apr 14, 2023
@araffin araffin deleted the feat/gymnasium-support branch April 14, 2023 11:14
@jkterry1
Copy link
Contributor

Just so I know- what's the plan for making a release that includes this PR?

@araffin
Copy link
Member Author

araffin commented Apr 14, 2023

Just so I know- what's the plan for making a release that includes this PR?

Alpha release is already on pypi since 15 days, stable release will be in some weeks if everything is fine.

AkashKarnatak added a commit to AkashKarnatak/FinRL that referenced this pull request Jun 10, 2023
zhumingpassional pushed a commit to AI4Finance-Foundation/FinRL that referenced this pull request Jun 15, 2023
* After [this](DLR-RM/stable-baselines3@9c338f9) by `stable-baselines3`, DummyVecEnv.reset() method passes a `seed` argument to its list of envs. Since StockTradingEnv.reset() does not expect any argument it results in an error. This commit fixes #1022.

* DummyVecEnv.render() no longer returns the expected state after [this](DLR-RM/stable-baselines3#1327) pull request got merged in `stable-baselines3`. This commit fixes #1010
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment