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

Errors in playback for sample demonstrations #451

Open
AstroTheKat opened this issue Feb 9, 2024 · 2 comments
Open

Errors in playback for sample demonstrations #451

AstroTheKat opened this issue Feb 9, 2024 · 2 comments
Assignees

Comments

@AstroTheKat
Copy link

I'm on an M1 MacBook with robosuite installed from source (on the master branch).

I've run into errors with playback for all of the sample demonstrations in robosuite/models/assets/demonstrations, when running python playback_demonstrations_from_hdf5.py from the robosuite/scripts folder.

The command python playback_demonstrations_from_hdf5.py --folder ../models/assets/demonstrations/lift/ gives me the error:

Output
Playing back random episode... (press ESC to quit)
Traceback (most recent call last):
  File "/Users/astro/robosuite/robosuite/scripts/playback_demonstrations_from_hdf5.py", line 70, in <module>
    env.reset_from_xml_string(xml)
  File "/Users/astro/robosuite/robosuite/environments/base.py", line 560, in reset_from_xml_string
    self.reset()
  File "/Users/astro/robosuite/robosuite/environments/base.py", line 258, in reset
    self._reset_internal()
  File "/Users/astro/robosuite/robosuite/environments/manipulation/lift.py", line 389, in _reset_internal
    super()._reset_internal()
  File "/Users/astro/robosuite/robosuite/environments/robot_env.py", line 510, in _reset_internal
    super()._reset_internal()
  File "/Users/astro/robosuite/robosuite/environments/base.py", line 305, in _reset_internal
    self._setup_references()
  File "/Users/astro/robosuite/robosuite/environments/manipulation/lift.py", line 335, in _setup_references
    super()._setup_references()
  File "/Users/astro/robosuite/robosuite/environments/robot_env.py", line 313, in _setup_references
    super()._setup_references()
  File "/Users/astro/robosuite/robosuite/environments/base.py", line 206, in _setup_references
    self.model.generate_id_mappings(sim=self.sim)
  File "/Users/astro/robosuite/robosuite/models/tasks/task.py", line 115, in generate_id_mappings
    get_ids(sim=sim, elements=model.visual_geoms + model.contact_geoms, element_type="geom"),
  File "/Users/astro/robosuite/robosuite/utils/mjcf_utils.py", line 853, in get_ids
    elements = [get_ids(sim=sim, elements=ele, element_type=element_type, inplace=True) for ele in elements]
  File "/Users/astro/robosuite/robosuite/utils/mjcf_utils.py", line 853, in <listcomp>
    elements = [get_ids(sim=sim, elements=ele, element_type=element_type, inplace=True) for ele in elements]
  File "/Users/astro/robosuite/robosuite/utils/mjcf_utils.py", line 842, in get_ids
    elements = sim.model.geom_name2id(elements)
  File "/Users/astro/robosuite/robosuite/utils/binding_utils.py", line 393, in geom_name2id
    raise ValueError('No "geom" with name %s exists. Available "geom" names = %s.' % (name, self.geom_names))
ValueError: No "geom" with name robot0_link7_collision exists. Available "geom" names = ('floor', 'wall_leftcorner_visual', 'wall_rightcorner_visual', 'wall_left_visual', 'wall_right_visual', 'wall_rear_visual', 'wall_front_visual', 'table_collision', 'table_visual', 'table_leg1_visual', 'table_leg2_visual', 'table_leg3_visual', 'table_leg4_visual', 'robot0_g0_vis', 'robot0_g1_vis', 'robot0_g2_vis', 'robot0_g3_vis', 'robot0_g4_vis', 'robot0_g5_vis', 'robot0_g6_vis', 'robot0_g7_vis', 'robot0_g8_vis', 'robot0_g9_vis', 'robot0_g10_vis', 'robot0_g11_vis', 'robot0_link0_collision', 'robot0_g12_vis', 'robot0_link1_collision', 'robot0_g13_vis', 'robot0_link2_collision', 'robot0_g14_vis', 'robot0_g15_vis', 'robot0_g16_vis', 'robot0_g17_vis', 'robot0_link3_collision', 'robot0_g18_vis', 'robot0_g19_vis', 'robot0_g20_vis', 'robot0_g21_vis', 'robot0_link4_collision', 'robot0_g22_vis', 'robot0_g23_vis', 'robot0_g24_vis', 'robot0_link5_collision', 'robot0_g25_vis', 'robot0_g26_vis', 'robot0_g27_vis', 'robot0_g28_vis', 'robot0_g29_vis', 'robot0_g30_vis', 'robot0_g31_vis', 'robot0_g32_vis', 'robot0_g33_vis', 'robot0_g34_vis', 'robot0_g35_vis', 'robot0_g36_vis', 'robot0_g37_vis', 'robot0_g38_vis', 'robot0_g39_vis', 'robot0_g40_vis', 'robot0_g41_vis', 'robot0_link6_collision', 'robot0_g42_vis', 'robot0_g43_vis', 'robot0_g44_vis', 'robot0_g45_vis', 'robot0_g46_vis', 'robot0_g47_vis', 'robot0_g48_vis', 'robot0_g49_vis', 'gripper0_hand_visual', 'gripper0_hand_collision', 'gripper0_finger1_visual', 'gripper0_finger1_collision', 'gripper0_finger1_pad_collision', 'gripper0_finger2_visual', 'gripper0_finger2_collision', 'gripper0_finger2_pad_collision', 'mount0_controller_box_col', 'mount0_pedestal_feet_col', 'mount0_torso_vis', 'mount0_pedestal_vis', 'mount0_pedestal_col', 'cube_g0', 'cube_g0_vis').

The command python playback_demonstrations_from_hdf5.py --folder ../models/assets/demonstrations/handover/panda_panda gives me the error:

Output
Traceback (most recent call last):
  File "/Users/astro/robosuite/robosuite/scripts/playback_demonstrations_from_hdf5.py", line 44, in <module>
    env_info = json.loads(f["data"].attrs["env_info"])
  File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
  File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
  File "/opt/homebrew/Caskroom/miniforge/base/envs/robosuite/lib/python3.9/site-packages/h5py/_hl/attrs.py", line 56, in __getitem__
    attr = h5a.open(self._id, self._e(name))
  File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
  File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
  File "h5py/h5a.pyx", line 80, in h5py.h5a.open
KeyError: "Can't open attribute (can't locate attribute: 'env_info')"

The command python playback_demonstrations_from_hdf5.py --folder ../models/assets/demonstrations/wipe/panda gives me the error (possibly related to #303):

Output
Playing back random episode... (press ESC to quit)
Traceback (most recent call last):
  File "/Users/astro/robosuite/robosuite/scripts/playback_demonstrations_from_hdf5.py", line 69, in <module>
    xml = env.edit_model_xml(model_xml)
  File "/Users/astro/robosuite/robosuite/environments/base.py", line 523, in edit_model_xml
    tree = ET.fromstring(xml_str)
  File "/opt/homebrew/Caskroom/miniforge/base/envs/robosuite/lib/python3.9/xml/etree/ElementTree.py", line 1343, in XML
    return parser.close()
xml.etree.ElementTree.ParseError: syntax error: line 1, column 0

Any idea what might be happening here? Thank you!

@abhihjoshi
Copy link
Contributor

Might be that the demos are outdated potentially? If you install with pip, does it give you the same issue?

@AstroTheKat
Copy link
Author

AstroTheKat commented Feb 13, 2024

Thanks for the suggestion! I switched to the pip installation. The lift demo works now, but I get what looks like the same errors for handover and wipe.

For python playback_demonstrations_from_hdf5.py --folder ../models/assets/demonstrations/handover/panda_panda, I get:

Traceback (most recent call last):
  File "/Users/astro/robosuite/robosuite/scripts/playback_demonstrations_from_hdf5.py", line 44, in <module>
    env_info = json.loads(f["data"].attrs["env_info"])
  File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
  File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
  File "/opt/homebrew/Caskroom/miniforge/base/envs/robosuite/lib/python3.9/site-packages/h5py/_hl/attrs.py", line 56, in __getitem__
    attr = h5a.open(self._id, self._e(name))
  File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
  File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
  File "h5py/h5a.pyx", line 80, in h5py.h5a.open
KeyError: "Can't open attribute (can't locate attribute: 'env_info')"

For python playback_demonstrations_from_hdf5.py --folder ../models/assets/demonstrations/wipe/panda, I get:

Playing back random episode... (press ESC to quit)
Traceback (most recent call last):
  File "/Users/astro/robosuite/robosuite/scripts/playback_demonstrations_from_hdf5.py", line 69, in <module>
    xml = env.edit_model_xml(model_xml)
  File "/Users/astro/robosuite/robosuite/environments/base.py", line 520, in edit_model_xml
    tree = ET.fromstring(xml_str)
  File "/opt/homebrew/Caskroom/miniforge/base/envs/robosuite/lib/python3.9/xml/etree/ElementTree.py", line 1343, in XML
    return parser.close()
xml.etree.ElementTree.ParseError: syntax error: line 1, column 0

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