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

AttributeError while creating Brax Systems #410

Closed
brn-dev opened this issue Oct 19, 2023 · 2 comments
Closed

AttributeError while creating Brax Systems #410

brn-dev opened this issue Oct 19, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@brn-dev
Copy link
Contributor

brn-dev commented Oct 19, 2023

I wanted to try out your colab notebooks (e.g. https://colab.research.google.com/github/google/brax/blob/main/notebooks/basics.ipynb#scrollTo=7GhvlPFTCbuq), but when I'm executing the second cell where Brax Systems are created I get the following error:

/usr/local/lib/python3.10/dist-packages/brax/io/mjcf.py in loads(xml, asset_path)
523 mj = mujoco.MjModel.from_xml_string(xml, assets=assets)
524
--> 525 return load_model(mj)
526
527

/usr/local/lib/python3.10/dist-packages/brax/io/mjcf.py in load_model(mj)
269 if (mj.geom_priority[0] != mj.geom_priority).any():
270 raise NotImplementedError('geom_priority parameter not supported.')
--> 271 if mj.opt.collision == 1:
272 raise NotImplementedError('Predefined collisions not supported.')
273 q_width = {0: 7, 1: 4, 2: 1, 3: 1}

AttributeError: 'mujoco._structs.MjOption' object has no attribute 'collision'

The collision attribute was removed in this commit of mujoco:
google-deepmind/mujoco@9cf1f6e

Is there a workaround to fix this error?

@brn-dev
Copy link
Contributor Author

brn-dev commented Oct 19, 2023

The offending line can be found here: https://github.com/google/brax/blob/main/brax/io/mjcf.py#L271

Can it simply be removed now, since the attribute doesn't exist anymore and it would only raise an error anyway?

If it can be removed: #411

@btaba btaba added the bug Something isn't working label Oct 19, 2023
@btaba btaba closed this as completed Oct 19, 2023
@btaba
Copy link
Collaborator

btaba commented Oct 19, 2023

Thanks @brn-dev for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants