MyoHub / myosuite

MyoSuite is a collection of environments/tasks to be solved by musculoskeletal models simulated with the MuJoCo physics engine and wrapped in the OpenAI gym API.
https://sites.google.com/view/myosuite
Apache License 2.0
843 stars 108 forks source link

Mummified Musculoskeletal Model #182

Open irfanmohamed12 opened 3 months ago

irfanmohamed12 commented 3 months ago

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

Vittorio-Caggiano commented 3 months ago

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

Vittorio-Caggiano commented 2 months ago

@irfanmohamed12 is this issue still open?

irfanmohamed12 commented 2 months ago

it is still open indeed...

Vittorio-Caggiano commented 2 months ago

@elladyr can you help replicating this issue?

elladyr commented 1 month ago

@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
  2. Win 11 Pro

    • Python 3.9.13
    • Python 3.10.14
  3. Win 11 WSL (Ubuntu 20.04)

    • Python 3.9.13
    • Python 3.10.14
  4. 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?

PeterHe0226 commented 1 month ago

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

Vittorio-Caggiano commented 1 month ago

thanks @PeterHe0226, really appreciate your help!

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

vikashplus commented 1 month ago

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 commented 1 month ago

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

elladyr commented 1 month ago

@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

Win 11 Pro

Win 11 WSL (Ubuntu 20.04)

Render modes

vikashplus commented 1 month ago

@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
elladyr commented 1 month ago

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

Checked for Myosuite versions

using

python 3.8.18 
pip 23.3.1
numpy 1.24.4

No convex hull activated screenshot_output

vikashplus commented 1 month ago

That confirms that it's a dependency issue.

Vittorio-Caggiano commented 1 month ago

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

vikashplus commented 1 month ago

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

gandie commented 4 weeks ago

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.