-
Notifications
You must be signed in to change notification settings - Fork 104
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
examples now support gym 0.26 #215
Conversation
I believe there should be some changes to sb3_examples, and not sure if cleanrl_examples can run successfully.
|
@araffin does sb3 support gym>=0.26 now? |
@Trinkle23897 In sb3 script, the |
we have a branch for that (DLR-RM/stable-baselines3#780) but as we use a wrapper anyway, we can support gym 0.26. |
I have tested all examples with gym=0.26 and gym=0.21. Also, the sb3 example can now handle gym=0.26.
|
env.step = legacy_step | ||
return env | ||
|
||
test_env = legacy_wrap(gym.make(env_id)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw is it possible to work out-of-box if we don't add legacy_wrap
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without the wrap, it wouldn't work with gym=0.26 using the latest version of sb3 on pip.
if is_legacy_gym: | ||
handle1, (new_states, rew, done, info) = step(handle0, action) | ||
else: | ||
handle1, (new_states, rew, term, trunc, info) = step(handle0, action) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
have you tested this for new gym version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. It works with both gym=0.26 and gym=0.21.
Description
Handle interface changes from gym >= 0.26 based on #205 .
Motivation and Context
Some of the examples break with gym >= 0.26
Types of changes
What types of changes does your code introduce? Put an
x
in all the boxes that apply:Implemented Tasks
examples
:xla_step.py
,acme_examples/
,cleanrl_examples/
andppo_atari/
Checklist
Go over all the following points, and put an
x
in all the boxes that apply.If you are unsure about any of these, don't hesitate to ask. We are here to help!
make format
(required)make lint
(required)make bazel-test
pass. (required)