myosuite icon indicating copy to clipboard operation
myosuite copied to clipboard

Mummified Musculoskeletal Model

Open irfanmohamed12 opened this issue 1 year ago • 16 comments

Executing a simple step of the environment results in a weird reproduction of the musculoskeletal model.

env = gym.make('myoElbowPose1D6MRandom-v0') env.reset() for _ in range(1000): env.mj_render() env.step(env.action_space.sample()) # take a random action env.close()

image

Any reason why this issue occurs?

Other information: Windows 11 Enterprise Python 3.9.13 Myosuite 2.4.0

irfanmohamed12 avatar Jul 05 '24 12:07 irfanmohamed12

hi @irfanmohamed12 , can you provide operating system, python version and myosuite version?

Vittorio-Caggiano avatar Jul 05 '24 12:07 Vittorio-Caggiano

@irfanmohamed12 is this issue still open?

Vittorio-Caggiano avatar Aug 06 '24 06:08 Vittorio-Caggiano

it is still open indeed...

irfanmohamed12 avatar Aug 07 '24 16:08 irfanmohamed12

@elladyr can you help replicating this issue?

Vittorio-Caggiano avatar Aug 07 '24 16:08 Vittorio-Caggiano

@Vittorio-Caggiano I managed to replicate this issue on a few combinations of platform and Myosuite versions

  1. Myosuite versions
  • 2.4.0
  • 2.5.0
  1. Win 11 Pro
  • Python 3.9.13
  • Python 3.10.14
  1. Win 11 WSL (Ubuntu 20.04)
  • Python 3.9.13
  • Python 3.10.14
  1. Render modes
  • Onscreen rendering - mj_render(), env.renderer.render_to_window()
  • Offscreen rendering - env.renderer.render_offscreen()

When rendering, it seems that the convex hull flag is always activated. This affects all the myoElbow and myoElbowExo environments. I have also checked on the Locomotion environments and they are unaffected.

How should we proceed in this case?

elladyr avatar Aug 11 '24 23:08 elladyr

To solve the issue, unwrap the linen on the mummy manually. First import Numpy, then use np.unwrap() until the body is exposed.

PeterHe0226 avatar Aug 15 '24 21:08 PeterHe0226

thanks @PeterHe0226, really appreciate your help!

Can you please add a snippet of code how this fix should run?

Vittorio-Caggiano avatar Aug 16 '24 07:08 Vittorio-Caggiano

I just tested it on Mac with MyoSuite version: 2.5.0 and it looks perfect. So we can rule out MyoSuite versioning being the issue.

python myosuite/utils/examine_env.py -e myoElbowPose1D6MRandom-v0

Next is to check the list of dependencies. We have a suspicion that this is related to Python and Numpy versions.

Here is what I have and what my outputs look like

python 3.8.18 
pip 23.3.1
numpy 1.24.4
image

vikashplus avatar Sep 04 '24 19:09 vikashplus

@elladyr - can you try versions I posted above on windows so we can rule out platforms as the issue as well.

vikashplus avatar Sep 04 '24 19:09 vikashplus

@vikashplus

I checked the version already and it is a specific Windows problem. When rendering, it seems that the convex hull flag is always activated. This affects all the myoElbow and myoElbowExo environments. I have also checked on the Locomotion environments and they are unaffected.

How should we proceed in this case?

Tested on: Myosuite versions

  • 2.4.0
  • 2.5.0

Win 11 Pro

  • Python 3.9.13
  • Python 3.10.14

Win 11 WSL (Ubuntu 20.04)

  • Python 3.9.13
  • Python 3.10.14

Render modes

  • Onscreen rendering - mj_render(), env.renderer.render_to_window()
  • Offscreen rendering - env.renderer.render_offscreen()

elladyr avatar Sep 04 '24 21:09 elladyr

@elladyr Can you try the latest MyoSuite with these versions of python, pip, and numpy

python 3.8.18 
pip 23.3.1
numpy 1.24.4

vikashplus avatar Sep 04 '24 22:09 vikashplus

Checked with both Win 11 Pro and Win 11 WSL (Ubuntu 20.04).

Checked for Myosuite versions

  • 2.4.0
  • 2.5.0

using

python 3.8.18 
pip 23.3.1
numpy 1.24.4

No convex hull activated screenshot_output

elladyr avatar Sep 04 '24 23:09 elladyr

That confirms that it's a dependency issue.

vikashplus avatar Sep 05 '24 14:09 vikashplus

this seems to be a MuJoCo issue about not supporting yet numpy> 2.0 https://github.com/google-deepmind/mujoco/issues/1808#issuecomment-2328732267

Vittorio-Caggiano avatar Sep 05 '24 19:09 Vittorio-Caggiano

Should we pin the Python version and numpy version in that case?

vikashplus avatar Sep 05 '24 21:09 vikashplus

Can confirm this issue on Windows 11 using Python 3.12 .

Workaround was to install yet another Python Interpreter ( 3.8 , im a collector, gotta install em all 😄 ) and rebuild virtualenv with it.

Should we pin the Python version and numpy version in that case?

If u pin to Python3.8 and numpy < 2.0 u need to remember to unpin as soon as the MuJoCo guys bump to numpy > 2.0 .

I suggest linking the information from this issues in README in order to point people to the solution for now.

gandie avatar Sep 07 '24 10:09 gandie