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

reset() showing NotImplementedError for ObservationWrapper #3308

Open
aswincs opened this issue Feb 5, 2025 · 4 comments
Open

reset() showing NotImplementedError for ObservationWrapper #3308

aswincs opened this issue Feb 5, 2025 · 4 comments

Comments

@aswincs
Copy link

aswincs commented Feb 5, 2025

While using reset() Pong environment using ObservtaionWrapper, getting error:

File "/home/robot/.local/lib/python3.10/site-packages/gym/core.py", line 380, in reset
return self.observation(obs), info
File "/home/robot/.local/lib/python3.10/site-packages/gym/core.py", line 389, in observation
raise NotImplementedError

gym version: 0.26.2
evn = 'PongNoFrameskip-v4'

Any idea on fixing this issue?

Thanks

@pseudo-rnd-thoughts
Copy link
Contributor

Could you provide a minimal example?
ObservationWrapper doesn't do anything by default.
You need to define the observation function, with many build in wrapper for different things

@aswincs
Copy link
Author

aswincs commented Feb 5, 2025

Project:
https://github.com/aswincs/DeepQLearning_PhilTabor/blob/main/DQN/main_dqn.py

Error:
Traceback (most recent call last):
File "/home/robot/DeepQLearning_PhilTabor/DQN/main_dqn.py", line 30, in
observation = env.reset()
File "/home/robot/DeepQLearning_PhilTabor/DQN/util.py", line 104, in reset
observation = self.env.reset()
File "/home/robot/.local/lib/python3.10/site-packages/gym/core.py", line 380, in reset
return self.observation(obs), info
File "/home/robot/.local/lib/python3.10/site-packages/gym/core.py", line 389, in observation
raise NotImplementedError
NotImplementedError

@pseudo-rnd-thoughts
Copy link
Contributor

pseudo-rnd-thoughts commented Feb 5, 2025

@aswincs
Copy link
Author

aswincs commented Feb 16, 2025

I couldn't fix this issue.

Is this issue because, for gym.ObservationWrapperdo we have to use custom observation

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