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

The bug when convert the demo data? #32

Open
yingfei1016 opened this issue Aug 1, 2024 · 11 comments
Open

The bug when convert the demo data? #32

yingfei1016 opened this issue Aug 1, 2024 · 11 comments

Comments

@yingfei1016
Copy link

Hi,

When I convert the demo data to get the RGB video by https://github.com/haosulab/ManiSkill2-Learn/blob/main/scripts/example_demo_conversion/general_rigid_body_single_object_envs.sh . Some tasks will get error. I use the main branch of the ManiSkill2-Learn. For example:
1、TypeError: Wrapper.reset() got an unexpected keyword argument 'episode_idx'
command:
`
ENV="PandaAvoidObstacles-v0"
python -m mani_skill2.trajectory.replay_trajectory --num-procs 4
--traj-path demos/v0/rigid_body/$ENV/trajectory.h5
--save-traj
--target-control-mode pd_ee_delta_pose
--obs-mode none

python tools/convert_state.py
--env-name=$ENV
--num-procs=1
--traj-name=../ManiSkill2/demos/v0/rigid_body/$ENV/trajectory.none.pd_ee_delta_pose.h5
--json-name=../ManiSkill2/demos/v0/rigid_body/$ENV/trajectory.none.pd_ee_delta_pose.json
--output-name=../ManiSkill2/demos/v0/rigid_body/$ENV/trajectory.none.pd_ee_delta_pose_rgbd.h5
--control-mode=pd_ee_delta_pose
--max-num-traj=-1
--obs-mode=rgbd
--reward-mode=dense
`
Error:

Reset kwargs for the current trajectory: {'seed': 0, 'episode_idx': 0} Traceback (most recent call last): File "/home/megvii/omniverse/ov/pkg/ManiSkill2-Learn/tools/convert_state.py", line 254, in <module> main() File "/home/megvii/omniverse/ov/pkg/ManiSkill2-Learn/tools/convert_state.py", line 231, in main convert_state_representation(keys, args, 0, os.getpid(), *extra_args) File "/home/megvii/omniverse/ov/pkg/ManiSkill2-Learn/tools/convert_state.py", line 84, in convert_state_representation env.reset(**reset_kwargs[cur_episode_num]) File "/home/megvii/omniverse/ov/pkg/ManiSkill2-Learn/maniskill2_learn/env/wrappers.py", line 100, in reset obs, _ = self.env.reset(*args, **kwargs) # ignore reset info in gymnasium File "/home/megvii/.local/lib/python3.10/site-packages/gymnasium/wrappers/time_limit.py", line 75, in reset return self.env.reset(**kwargs) File "/home/megvii/omniverse/ov/pkg/ManiSkill2-Learn/maniskill2_learn/env/wrappers.py", line 223, in reset obs, reset_info = self.env.reset(**kwargs) File "/home/megvii/omniverse/ov/pkg/ManiSkill2-Learn/maniskill2_learn/env/wrappers.py", line 692, in reset obs, reset_info = super().reset(**kwargs) TypeError: Wrapper.reset() got an unexpected keyword argument 'episode_idx'

2、TypeError: Wrapper.reset() got an unexpected keyword argument 'model_id'
command:
`
ENV="PickSingleEGAD-v0"
python -m mani_skill2.trajectory.replay_trajectory --num-procs 4
--traj-path demos/v0/rigid_body/$ENV/trajectory.h5
--save-traj
--target-control-mode pd_ee_delta_pose
--obs-mode none

python tools/convert_state.py
--env-name=$ENV
--num-procs=1
--traj-name=../ManiSkill2/demos/v0/rigid_body/$ENV/trajectory.none.pd_ee_delta_pose.h5
--json-name=../ManiSkill2/demos/v0/rigid_body/$ENV/trajectory.none.pd_ee_delta_pose.json
--output-name=../ManiSkill2/demos/v0/rigid_body/$ENV/trajectory.none.pd_ee_delta_pose_rgbd.h5
--control-mode=pd_ee_delta_pose
--max-num-traj=-1
--obs-mode=rgbd
--reward-mode=dense
`
Error:

`
Reset kwargs for the current trajectory: {'seed': 0, 'model_id': 'A10_0'}
Traceback (most recent call last):
File "/home/megvii/omniverse/ov/pkg/ManiSkill2-Learn/tools/convert_state.py", line 254, in
main()
File "/home/megvii/omniverse/ov/pkg/ManiSkill2-Learn/tools/convert_state.py", line 231, in main
convert_state_representation(keys, args, 0, os.getpid(), *extra_args)
File "/home/megvii/omniverse/ov/pkg/ManiSkill2-Learn/tools/convert_state.py", line 84, in convert_state_representation
env.reset(**reset_kwargs[cur_episode_num])
File "/home/megvii/omniverse/ov/pkg/ManiSkill2-Learn/maniskill2_learn/env/wrappers.py", line 100, in reset
obs, _ = self.env.reset(*args, **kwargs) # ignore reset info in gymnasium
File "/home/megvii/.local/lib/python3.10/site-packages/gymnasium/wrappers/time_limit.py", line 75, in reset
return self.env.reset(**kwargs)
File "/home/megvii/omniverse/ov/pkg/ManiSkill2-Learn/maniskill2_learn/env/wrappers.py", line 223, in reset
obs, reset_info = self.env.reset(**kwargs)
File "/home/megvii/omniverse/ov/pkg/ManiSkill2-Learn/maniskill2_learn/env/wrappers.py", line 692, in reset
obs, reset_info = super().reset(**kwargs)
TypeError: Wrapper.reset() got an unexpected keyword argument 'model_id'

`

@xuanlinli17
Copy link
Collaborator

xuanlinli17 commented Aug 1, 2024

@xuanlinli17
Copy link
Collaborator

Also please note that different scripts have comments indicating the envs they apply.

@yingfei1016
Copy link
Author

What scripts should the PandaAvoidObstacles-v0 use?

@yingfei1016
Copy link
Author

Can you look at my error again? I just used https://github.com/haosulab/maniskill2-learn/blob/main/scripts/example _ demo _ conversion/general _ rigid _ body _ single _ object _ envs.sh, but I got an error when env reset.

Thank you!

@yingfei1016
Copy link
Author

File "/home/megvii/omniverse/ov/pkg/ManiSkill2-Learn/maniskill2_learn/env/wrappers.py", line 692, in reset obs, reset_info = super().reset(**kwargs) TypeError: Wrapper.reset() got an unexpected keyword argument 'episode_idx'

@yingfei1016
Copy link
Author

If the 'episode_idx' and 'model_id' are not necessary, I will remove them directly.

@xuanlinli17
Copy link
Collaborator

xuanlinli17 commented Aug 1, 2024

Which commit of ManiSkill2 are you using?

episode_idx and model_id are needed.

@yingfei1016
Copy link
Author

yingfei1016 commented Aug 1, 2024

I install the ManiSkill2 by pip install, the version is 0.5.3
maniSkill2_learn is 1.8.0b0

@yingfei1016
Copy link
Author

I try to use the ManiSkill2==0.5.0, but still has this problem.

@yingfei1016
Copy link
Author

@xuanlinli17 If you have any solution to solve this problem?

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