brax icon indicating copy to clipboard operation
brax copied to clipboard

Switch gym dependency to gymnasium

Open giotherobot opened this issue 1 year ago • 8 comments

Since gym is deprecated in favor of gymnasium (see https://github.com/openai/gym?tab=readme-ov-file#important-notice) here I propose the switch, allowing both installation as alternative to keep backwards compatibilty.

This allows for use of python>=3.10, that is incompatible with gym.

Possible fix for #421.

giotherobot avatar May 14 '24 10:05 giotherobot

Just a note: I think the Gym wrappers here use the gym step format, not the gymnasium step format with terminated and truncated. Perhaps these would also need to be updated, as well as the pytorch training notebook that used those wrappers.

lebrice avatar Jun 03 '24 16:06 lebrice

Hi @lebrice can you add gymnasium to the requirements, so that the builds pass? Thank you!

btaba avatar Jun 07 '24 15:06 btaba

The idea was to keep both the gym and gymnasium dependencies and let the user install the preferred one, I guess this needs modification of the CI to install one of the two.

Or if you prefer I can drop the gym dependency and just keep the gymnasium one.

giotherobot avatar Jun 07 '24 15:06 giotherobot

Ah ok, sorry I was misreading this. I think the right thing to do is what @lebrice is saying. Switch to gymnasium altogether and hash out differences in the API calls in brax. You can ignore brax/v1 entirely since it's deprecated. How does that sound?

btaba avatar Jun 07 '24 15:06 btaba

I can work on that, should be easier than what I was trying to do here!

giotherobot avatar Jun 07 '24 16:06 giotherobot

@giotherobot any updates? Will close the PR if there is no further activity

btaba avatar Jan 31 '25 22:01 btaba

Will this PR be merged in soon? Thanks.

lupusorina avatar Feb 24 '25 18:02 lupusorina

@giotherobot any updates? Will close the PR if there is no further activity

The concern raised in https://github.com/google/brax/pull/486#issuecomment-2145694952 should be addressed by c5bb67f (#486) so I think this PR is ready.

giotherobot avatar Mar 06 '25 10:03 giotherobot

Is there any update on this PR?

fei-yang-wu avatar Aug 07 '25 18:08 fei-yang-wu