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

[Bug Report] Temporary XML file is written to fixed path #184

Closed
1 task done
nicoguertler opened this issue Oct 6, 2023 · 7 comments
Closed
1 task done

[Bug Report] Temporary XML file is written to fixed path #184

nicoguertler opened this issue Oct 6, 2023 · 7 comments

Comments

@nicoguertler
Copy link

Hi,

I would like to report a behavior of the Maze class that I believe to be a bug.

Describe the bug
The temporary XML file is always written to the same fixed path (on my system /tmp/ant_maze.xml). That leads to crashes if several processes try to instantiate an environment.

Code example

import gymnasium as gym

env = gym.vector.AsyncVectorEnv([lambda: gym.make("PointMaze_Open-v3") for _ in range(10)])

This produces

ValueError: XML parse error 13:
Error=XML_ERROR_EMPTY_DOCUMENT ErrorID=13 (0xd) Line number=0

among other parsing errors.

System Info

  • I am running Ubuntu 20.04.06
  • Gymnasium was installed via pip.
  • Python 3.8.10

Additional context
It looks like the problem is caused by the use of path.dirname(tmp_dir) here which effectively discards the temporary directory created in the line above.

Thank you for your help!

Checklist

  • I have checked that there is no similar issue in the repo (required)
@nicoguertler
Copy link
Author

On second thought I can see that this behavior is probably intended because the temporary directory gets removed again, sorry. I think it is still problematic though and would like to inquire if there is a chance that this problem will be solved.

@roger-creus
Copy link

I'm facing the same issue when running the code in a cluster. The funny thing is that it won't always crash, only sometimes. Please let me know if you fix this issue.

@Kallinteris-Andreas
Copy link
Collaborator

The maze environments were made prior to vector_env so it did not support it

PR #185 should fix the issue
@nicoguertler @roger-creus can you try it, to make sure it fixes your issue
Thanks

@roger-creus
Copy link

This solves it @Kallinteris-Andreas ! Thank you!

@nicoguertler
Copy link
Author

Works perfectly for me. Thank you very much @Kallinteris-Andreas !

@Kallinteris-Andreas
Copy link
Collaborator

@rodrigodelazcano close

@rodrigodelazcano
Copy link
Member

rodrigodelazcano commented Oct 19, 2023

Hey @Kallinteris-Andreas I just wanted to make sure that this issue is solved in every affected environment (mamujoco) as you mentioned in #185 (comment) before closing the issue

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