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

[Bug Report] ViewSizeWrapper ignored with RGBImgPartialObsWrapper #419

Open
1 task done
lpjiang97 opened this issue Feb 16, 2024 · 1 comment
Open
1 task done

Comments

@lpjiang97
Copy link

Describe the bug
When wrapped after the RGBImgPartialObsWrapper, the agent_view_size set in ViewSizeWrapper is ignored.

Code example

env = gym.make("MiniGrid-Empty-8x8-v0")
env = RGBImgPartialObsWrapper(ViewSizeWrapper(env, agent_view_size=5))
env = ImgObsWrapper(env)

obs, info = env.reset(seed=10)
print(env.agent_view_size) # returns 5
plt.imshow(obs)

The image plotted shows a view size of 7.

System Info

  • minigrid was pip installed.
  • Cent OS with Python 3.10

Checklist

  • I have checked that there is no similar issue in the repo (required)
@vishwassathish
Copy link

vishwassathish commented Feb 25, 2024

I created a pull request to resolve this bug. After the ViewSizeWrapper, env.unwrapped.agent_view_size remains at its default value of 7 which the RGBImgPartialObsWrapper uses.

env = gym.make("MiniGrid-Empty-8x8-v0")
env = ViewSizeWrapper(env, agent_view_size=5)

obs, info = env.reset(seed=10)
print(env.agent_view_size)                  # returns 5
print(env.unwrapped.agent_view_size)        # returns 7

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

No branches or pull requests

2 participants