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

[RLlib] Fix gym.Wrapper problem for MA Envs. #8314

Conversation

sven1977
Copy link
Contributor

@sven1977 sven1977 commented May 4, 2020

When wrapping a MultiAgentEnv with a gym Wrapper, RLlib incorrectly pre-processes observations and crashes due to a Space mismatch. This PR makes sure that RLlib is always aware of the actual underlying (wrapped) Env.

Fixes issue #8303

Closes #8303

  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/latest/.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failure rates at https://ray-travis-tracker.herokuapp.com/.
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested (please justify below)

@AmplabJenkins
Copy link

Can one of the admins verify this patch?

@ericl
Copy link
Contributor

ericl commented May 4, 2020

You can't use a reward wrapper around a MultiAgentEnv though right? I don't think this is a valid use case.

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/25536/
Test PASSed.

@sven1977
Copy link
Contributor Author

sven1977 commented May 7, 2020

@ericl It would be intuitive, though. Can we merge this either way? We don't have to officially support it, but it would help a lot of users who are simply doing this for convenience and expect this to work fine (it does, after all).

@ericl
Copy link
Contributor

ericl commented May 7, 2020

I'm concerned this is a hacky behavior though. It doesn't really make sense to crawl the inheritance chain looking for a subclass signature. Also, there are clear workarounds to use non gym wrappers.

I think it would be asking trouble to start half supporting gym wrappers for multiagent envs, which were never intended to be compatible anyways.

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

Successfully merging this pull request may close these issues.

rllib: Using gym.RewardWrapper around MultiAgentEnv cause observation mismatch with observation_space
3 participants