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: 'dict2' object has no attribute 'mj_ray' #18

Open
emanuelepesce opened this issue Feb 11, 2020 · 8 comments
Open

AttributeError: 'dict2' object has no attribute 'mj_ray' #18

emanuelepesce opened this issue Feb 11, 2020 · 8 comments

Comments

@emanuelepesce
Copy link

emanuelepesce commented Feb 11, 2020

When running the example code:

bin/examine.py mae_envs/envs/base.py

I get the following error:

Loading env from the module: mae_envs/envs/base.py
Creating window glfw
Traceback (most recent call last):
  File "bin/examine.py", line 91, in <module>
    main()
  File "/home/ep15/.local/lib/python3.6/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/home/ep15/.local/lib/python3.6/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/home/ep15/.local/lib/python3.6/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/ep15/.local/lib/python3.6/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "bin/examine.py", line 47, in main
    env_viewer=EnvViewer)
  File "/home/ep15/libraries/mujoco-worldgen/mujoco_worldgen/util/envs/examine_env.py", line 32, in examine_env
    env_viewer(env).run()
  File "/home/ep15/libraries/multi-agent-emergence-environments/mae_envs/viewer/env_viewer.py", line 23, in __init__
    self.env_reset()
  File "/home/ep15/libraries/multi-agent-emergence-environments/mae_envs/viewer/env_viewer.py", line 59, in env_reset
    self.env.reset()
  File "/home/ep15/libraries/multi-agent-emergence-environments/mae_envs/wrappers/util.py", line 89, in reset
    obs = self.env.reset()
  File "/home/ep15/anaconda3/envs/py366_hideseek/lib/python3.6/site-packages/gym/core.py", line 259, in reset
    observation = self.env.reset(**kwargs)
  File "/home/ep15/anaconda3/envs/py366_hideseek/lib/python3.6/site-packages/gym/core.py", line 259, in reset
    observation = self.env.reset(**kwargs)
  File "/home/ep15/anaconda3/envs/py366_hideseek/lib/python3.6/site-packages/gym/core.py", line 260, in reset
    return self.observation(observation)
  File "/home/ep15/libraries/multi-agent-emergence-environments/mae_envs/wrappers/line_of_sight.py", line 28, in observation
    self.metadata['agent_geom_idxs'][j])
  File "/home/ep15/libraries/multi-agent-emergence-environments/mae_envs/util/vision.py", line 54, in insight
    dist, collision_geom = raycast(sim, geom1_id, geom2_id=geom2_id, pt2=pt2)
  File "/home/ep15/libraries/mujoco-worldgen/mujoco_worldgen/util/geometry.py", line 40, in raycast
    dist = functions.mj_ray(sim.model,
AttributeError: 'dict2' object has no attribute 'mj_ray'
@ronak1997
Copy link

Did you end up fixing this? I am encountering the same error...

@emanuelepesce
Copy link
Author

No, I didn't

@ronak1997
Copy link

Thanks for the reply. May I ask what kind of environment you were trying to run it on? Was it a VM? Ubuntu?

@emanuelepesce
Copy link
Author

Ubuntu 18.04

@Jim-Song
Copy link

Thanks for the reply. May I ask what kind of environment you were trying to run it on? Was it a VM? Ubuntu?

ubuntu 18.04 VM

@jman22-maker
Copy link

jman22-maker commented Aug 19, 2020 via email

@daiyl
Copy link

daiyl commented Mar 2, 2021

My mujoco-py==1.50.1.0 has the same problem "AttributeError: 'dict2' object has no attribute 'mj_ray'".
You can update the mujoco-py. It will run successfully.

pip3 install -U 'mujoco-py<1.50.2,>=1.50.1'

@whancock
Copy link

Thanks daiyl, your suggestion worked. I had to run the patchelf command first though. Look at the dockerfile in https://github.com/openai/mujoco-py/blob/1.50.1.0/Dockerfile for reference

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

6 participants