Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Alternative fix for gym 0.21 changes. #271

Merged
merged 1 commit into from
Oct 7, 2021
Merged

Alternative fix for gym 0.21 changes. #271

merged 1 commit into from
Oct 7, 2021

Conversation

heiner
Copy link
Contributor

@heiner heiner commented Oct 7, 2021

This is an alternative to #269 to fix #272.


The most recent version of gym wraps environments with the OrderEnforcing wrapper (https://github.com/openai/gym/blob/master/docs/wrappers.md) if not disabled. This breaks our tests, play.py and a number of other places. For instance, env.seed() with more than 1 argument now also fails due to gym.Wrapper.seed. Possible fixes:

  • Use env.unwrapped when arguments to seed are given
  • Disable the OrderEnforcing wrapper. This will break NLE when using earlier versions of the gym library unless we do per-version magic (as in this PR). We cannot test for the presence of OrderEnforcing as it's not exported into gym.wrappers (sigh).
  • Adhere to the gym environment better by doing seed(self, (core, disp, reseed)) instead of seed(self, core=None, disp=None, reseed=False).

We also use env._actions a bunch of times, in tests and in play.py. We should fix that, and other accesses to _underscored variables.

@cdmatters
Copy link
Contributor

I prefer this fix over #269 since the change is localised, and doesnt change behaviour for end users who chose to build on this. We should fix this properly later.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gym 0.21 breaks a bunch of stuff
2 participants