-
Notifications
You must be signed in to change notification settings - Fork 279
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
On resetting a state to a given state / Extracting image observation from past state? #439
Comments
One other solution that works is to store the sequence of actions taken after calling When I try the following :
I get
|
What version of Meta-World are you using? |
This is the commit I used to install (should be the latest one as I did it 4 days back.) metaworld @ git+https://github.com/Farama-Foundation/Metaworld.git@d155d0051630bb365ea6a824e02c66c068947439 I have had similar issues with v1 metaworld. |
It looks like you are using the Mujoco based (not mujoco-py) Meta-World where get_state and set_state don't function properly because of the change in bindings. As of right now the easiest thing to do would probably be something similar to the code you posted above: seed the environment with a specific seed, store actions, recreate the environment with that seed and apply the stored actions |
I can switch to the mujoco-py based one if it works there & you can share to how init envs through that. By tinkering some code I could save the mujoco internal state ( |
If you go back to the most recent commit before the bindings were changed, or use the v2.0.0 release zip, the code you posted above will work. There's no API changes |
Ok version 2.0.0 ftw! Do you have a timeline on when the get_state() etc for the most recent version can be corrected? I would be willing to pitch in if you want! Quick solution for other readers : |
If you want to try and tackle it, create a PR for it when it's complete. We also have an issue with using EZPickle #426 that could be related. Just don't have time to look into it. |
@reginald-mclean it seems that there is some bug either in mujoco bin or metaworld. The above works for me fine on macos (intel) but fails on Ubuntu (20). I can confirm that I'm running the same python version & the same metaworld version in both the cases, but when running on Ubuntu I keep getting all False. Do you have any idea why? Additional : |
While a proper fix comes along :
|
If it fixes the bug, it's not actually a bug. I think what happens is that your mac has a frame buffer that it can use to render, the headless Ubuntu you're using doesn't. The "xvfb-run -a" command does exactly that, creates a virtual frame buffer you can use. You can also use xvfb-run -a for running Python scripts by adding it to your command (ie xvfb-run -a python myFile.py) |
The key issue is that sim.render() method in mujocopy gives two different images even when run consecutively for the same sim state. This is unexpected afaik. This is resolved when I instead use the mjviewer & grab the image from it ( using xvfb ) instead of rendering in offscreen mode as is the default case in mujocopy. |
Suppose I sample several states in the past and store them. Is it possible to reset the environment object to a given past state quickly? I am flexible is storing necessary state information to make the re-store possible. However the solution must have low space complexity. For example, storing the observation (which is a few floats) is okay, but storing the mujoco sim state can be very expensive.
Motivation :
I care about obtaining the image observation from a past state. Since storing images on the go is not feasible for my setup, I wanted to explore solutions where I can store less data intensive information like the observation etc. that is enough to exactly restore the environment state to get the image (or if there are other faster methods to get the image back).
Thank you!
The text was updated successfully, but these errors were encountered: