-
-
Notifications
You must be signed in to change notification settings - Fork 609
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
FullyObsWrapper mission attribute not updated #62
Comments
I think the problem is likely here:
This trick just gets values from the env class and sets them on the wrapper, if I'm not mistaken. In order for the |
I ran into that problem while trying to integrate the Fetch environment within my homemade rl framework to do some multitask learning. This bug hasn't really caused me any problem; I'm simply retrieving the mission from the unwrapped environment instead. Your solution sounds fine : Instead of updating the object's dictionary on initialization, the getitem method could go fetch the unwrapped env's attribute if the wrapper does not have an attribute with the same name (such as self.observation_space). |
@DjAntaki would you like to submit a PR with this improvement? :) Also, curious. You're building your own RL framework, will that include your own implementation of PPO/A3C/DDPG/etc? Will you be using PyTorch? |
I wrote the override of the __getattr__ function (which is called when __getattribute__ raises an AttributeError) so that it goes retrieve the attribute of self.unwrapped. I then realised that the Wrapper class of gym already has that feature implemented (file core.py line 219). Commenting self.__dict__.update call you mentioned is sufficient to fix the problem. This raises the question as to what purposes that line served. I can submit a pull request with the calls commented. My framework uses PyTorch; I have my own implementation of Option-Critic and Mixture-Of-Experts networks, the rest algorithm-wise mostly come from other repositories. I built it out of nostalgia for the TrainingLoop class of the Blocks framework. Si tu veux on peut causer plus amplement sur le slack du mila, je risque d'y être plus rapide pour répondre. @antakiv |
Ha! I didn't know that. I'm not the one who originally added that line. Possibly, OpenAI Gym wrappers didn't always have this functionality... Or whoever did this has no idea what they were doing. Let's remove them all, and if the automated tests pass, good enough.
Very cool. I generally find most frameworks out there overcomplicated. They require too much boiletplate and have too many dependencies, are too easily broken. That would be my two cents. Minimize dependencies, keep the API simple and avoid implementing features people won't need. Did not realize you were at Mila! |
Hello there! I've found a small bug with the FullyObsWrapper I think. Cheers!
The text was updated successfully, but these errors were encountered: