[go: nahoru, domu]

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

[Question] Why gymnasium is pinned to 0.28.1 ? #1452

Closed
4 tasks done
duburcqa opened this issue Apr 14, 2023 · 7 comments
Closed
4 tasks done

[Question] Why gymnasium is pinned to 0.28.1 ? #1452

duburcqa opened this issue Apr 14, 2023 · 7 comments
Labels
question Further information is requested

Comments

@duburcqa
Copy link
duburcqa commented Apr 14, 2023

❓ Question

Is enforcing gymnasium==0.28.1 is strict requirement ? ray[rllib] has also pinned gymnasium but using a different version (0.26.3), so that installing both stable-baseline3 and ray[rllib] at the same time is raising an exception. Would be be possible to relax this requirement, typically by allowing the range of versions gynasium >= 0.26.3, <= 0.28.1 ?

Checklist

  • I have checked that there is no similar issue in the repo
  • I have read the documentation
  • If code there is, it is minimal and working
  • If code there is, it is formatted using the markdown code blocks for both code and stack traces.
@duburcqa duburcqa added the question Further information is requested label Apr 14, 2023
@araffin
Copy link
Member
araffin commented Apr 14, 2023

Hello,
You can find your answer in #1327 and https://github.com/DLR-RM/stable-baselines3/pull/780/files#r1116847655

TL;DR: The last year and a half has been a real pain in the neck for the SB3 devs, each new gym/gymnasium release came with breaking changes (more or less documented), so until gym is actually stable again, we have to pin to prevent any nasty surprises.
SB3 also requires the latest Gymnasium version for the type annotations (see discussions and bug found in the PR).

Note: it doesn't prevent you from installing ray by using --no-deps, I know it's not pretty but it works...

EDIT: I would rather push rllib to support latest Gymnasium version.

@duburcqa
Copy link
Author
duburcqa commented Apr 14, 2023

each new gym/gymnasium release came with breaking changes

Yes I know that, that is why I suggest a range instead of a single version. It already pervents this kind of issues. If you tell me this is only for typing, this is not a concern for 99% of the users, so it is a bit sad to make the life harder for the all community because of this. Does the range I suggest would be suitable except for typing ? If so, it may be a good compromise no ? If the user is doing a clean install the latest gymnasium version being compatible will be installed so it sounds good !

Note: it doesn't prevent you from installing ray by using --no-deps, I know it's not pretty but it works...

Yes and no. It will not work in general because you actaully need to install deps most of the time.

EDIT: I would rather push rllib to support latest Gymnasium version.

Ideally, but it is a company-owned project, so it is much harder to make it move forward. Plus their next release is not expected before 2 months at least if it goes as usual.

@araffin
Copy link
Member
araffin commented Apr 14, 2023

If you tell me this is only for typing, this is not a concern for 99% of the users, so it is a bit sad to make the life harder for the all community because of this.

So, unfortunately, in that case, SB3 breaks with earlier version of Gymnasium (Farama-Foundation/Gymnasium#337, ad48559):
TypeError: Too many parameters for <class 'gymnasium.core.Wrapper'>; actual 4, expected 2

but it is a company-owned project, so it is much harder to make it move forward.

company-owned project should also mean more resources...
I don't recall all the breaking changes, but they should try simply upgrading to 0.28.1 if they are not using gym type annotations.

@duburcqa
Copy link
Author

So, unfortunately, in that case, SB3 breaks with earlier version of Gymnasium

If stable-baseline3 is failing at runtime for any other version of gymnasium than 0.28.1 then I agree there is no solution...

company-owned project should also mean more resources...

Yes and no. They do, but only for what really matters for them and their clients, never for the open-source community.

@eccstartup

This comment was marked as off-topic.

@araffin

This comment was marked as off-topic.

@araffin
Copy link
Member
araffin commented Jul 31, 2023

Closing as original question was answered and PR is on its way in RLLib repo: ray-project/ray#35698
(SB3 master is also compatible with gymnasium 0.29)

@araffin araffin closed this as completed Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants