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

XML Error in playback_demonstrations_from_hdf5.py #303

Closed
PraveenElango opened this issue Mar 13, 2022 · 3 comments
Closed

XML Error in playback_demonstrations_from_hdf5.py #303

PraveenElango opened this issue Mar 13, 2022 · 3 comments
Assignees

Comments

@PraveenElango
Copy link
Contributor

PraveenElango commented Mar 13, 2022

Hi, I tried running the following line of code in my robosuite directory to load and play a sample demonstration:

python playback_demonstrations_from_hdf5.py --folder ../models/assets/demonstrations/wipe/panda

However, I got the following error:
Creating window glfw Playing back random episode... (press ESC to quit) model_1.xml Creating window glfw Traceback (most recent call last): File "/home/praveen/robosuite/robosuite/scripts/playback_demonstrations_from_hdf5.py", line 70, in <module> xml = postprocess_model_xml(model_xml) File "/home/praveen/robosuite/robosuite/utils/mjcf_utils.py", line 511, in postprocess_model_xml tree = ET.fromstring(xml_str) File "/home/praveen/miniconda3/lib/python3.9/xml/etree/ElementTree.py", line 1348, in XML return parser.close() xml.etree.ElementTree.ParseError: syntax error: line 1, column 0

I then changed tree = ET.fromstring(xml_str) to tree = ET.parse(xml_str).

However, I now get a new error:

Creating window glfw Playing back random episode... (press ESC to quit) model_1.xml Creating window glfw Traceback (most recent call last): File "/home/praveen/robosuite/robosuite/scripts/playback_demonstrations_from_hdf5.py", line 70, in <module> xml = postprocess_model_xml(model_xml) File "/home/praveen/robosuite/robosuite/utils/mjcf_utils.py", line 512, in postprocess_model_xml tree = ET.parse(xml_str) File "/home/praveen/miniconda3/lib/python3.9/xml/etree/ElementTree.py", line 1229, in parse tree.parse(source, parser) File "/home/praveen/miniconda3/lib/python3.9/xml/etree/ElementTree.py", line 569, in parse source = open(source, "rb") FileNotFoundError: [Errno 2] No such file or directory: 'model_1.xml'
May I ask how can this be fixed? Thank you!

@yukezhu yukezhu assigned amandlek and cremebrule and unassigned amandlek Mar 13, 2022
@yukezhu
Copy link
Member

yukezhu commented Mar 13, 2022

Hi @cremebrule this issue seems to come from the default wipe demonstrations collected on an older version of robosuite. I think the easiest way would be to recollect and update the demo files.

@cremebrule
Copy link
Member

Hmm, I no longer have the spacemouse currently to re-collect demos. @amandlek might you still have a spacemouse by any chance?

@yukezhu
Copy link
Member

yukezhu commented Dec 4, 2022

The playback_demonstrations_from_hdf5.py script should work now with the v1.4 release. Closing this issue now.

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

4 participants