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.
btw is it possible to work out-of-box if we don't add legacy_wrap?
There was a problem hiding this comment.
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.
have you tested this for new gym version?
There was a problem hiding this comment.
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
xin 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
xin 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-testpass. (required)