Closed Taskii-Lei closed 6 months ago
Hi @Taskii-Lei. Thank you for opening this issue. You are correct that the README.md needs to be updated :)
The API has changed slightly, it should now be something like:
env = benchmark.train_classes["pick-place-v2"](render_mode='rgb_array', camera_name='corner')
We don't get pass any height or width fields to the Gymnasium MujocoEnv class as of right now, so you will need to modify the Sawyer_XYZ base class as well:
mjenv_gym.__init__( self, model_name, frame_skip=frame_skip, observation_space=self.sawyer_observation_space, render_mode=render_mode, camera_name=camera_name, camera_id=camera_id, height = X, width = X, )
where X and Y are your desired render sizes. Let me know if that doesn't work!
I modified some parameters of related classes according to your tips, and now it runs very well! Thank you so much!
I'm going to close this issue, but feel free to open it if you find any other issues!
Thanks for your great work! I love the Metaworld! I want to render the env, and resize it to (64,64). But when I run
env.render(offscreen=True, resolution=(64,64), camera_name="corner")
, it raises error:TypeError: render() got an unexpected keyword argument 'offscreen'
. And so do the parameter 'resolution' . I have tried https://github.com/Farama-Foundation/Metaworld/issues/34, but it doesn't work for me.The Virtual Env: I followed the manual configuration, ran
pip install -e .
and succeeded. And I haveapt install xvfb
Machine: I run it on a remote machine.
Codes:
ERROR: File "/xxx/x/xxxx/test.py", line 4, in
env.render(offscreen=True, resolution=(64,64), camera_name="corner").shape
TypeError: MujocoEnv.render() got an unexpected keyword argument 'offscreen'
I was so confused if it's because any lib is missing or not installed? or versions mismatch?
BTW, the
env.step(a)
is not correct, cuz. I found the output is a 5-tuple, not 4-tuple. I read the source code and found it should be (see Metaworld/metaworld/envs/mujoco/sawyer_xyz/sawyer_xyz_env.py:614~620):The
truncate
is set as a done-flag, and the third one, which should be done-flag is set always False. The https://github.com/Farama-Foundation/Metaworld?tab=readme-ov-file#using-the-benchmark in README.md should be corrected or at least should be illustrated because it's a little bit misleading. Thank you !!