nghorbani/soma

ModuleNotFoundError: No module named 'psbody.smpl.fast_derivatives.smpl_derivatives'

Jgorin opened this issue · 4 comments

Hello,

Thanks so much for sharing this work! I get an error when trying to run mosh on labelled data:


Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.7/site-packages/psbody/smpl/__init__.py", line 6, in <module>
    from .serialization import *
  File "/usr/local/lib/python3.7/site-packages/psbody/smpl/serialization.py", line 12, in <module>
    from .posemapper import posemap
  File "/usr/local/lib/python3.7/site-packages/psbody/smpl/posemapper.py", line 12, in <module>
    from .rodrigues import Rodrigues
  File "/usr/local/lib/python3.7/site-packages/psbody/smpl/rodrigues.py", line 6, in <module>
    from .fast_derivatives.smpl_derivatives import Rodrigues as _Rodrigues
ModuleNotFoundError: No module named 'psbody.smpl.fast_derivatives.smpl_derivatives'

I verified that the psbody package is placed in the site-packages folder, and I can import psbody, but if I import psbody.smpl I get the same error.

I also was attempting to run the code for labelling unlabelled c3d files and was getting an OmegcaConf resolver error for resolve_mocap_subject(the same as here #8). Tracing through the soma and moshpp code, it looks like there isn’t a resolver set for resolve_mocap_subject, but it looks like resolve_mocap_session defined on line 164 of run_tools in moshpp (https://github.com/nghorbani/moshpp/blob/6599a2d7dde7baab67ef9d859c967c14c4e7badc/src/moshpp/tools/run_tools.py#L125) does what resolve_mocap_subject should do.

I also had the exact same issue as described here #16 and fixed in the exact same manner which seems to work.

gfgb commented

Hi @Jgorin! I tried to reproduce this error by setting up an environment and copying the content of the smpl-fast-derivatives .tar.bz2archive to the site-packages folder, however running import psbody.smpl works for me.
I see that the path of your Python folder is /usr/local/lib/python3.7/. Are you sure you set up the Python environment correctly and you copied the files the content of the archive to the right site-packages folder?

I'm having this exact same problem, and I'm 100% sure I put it in the correct site-packages folder. PyCharm is even able to suggest smpl when I type import psbody., but when I try to execute the import statement Python fails to find it.

I finally found the problem (and a potential solution).

The install instructions here are problematic:

soma/README.md

Lines 38 to 43 in 1e3bf3c

Copy the precompiled
[smpl-fast-derivatives](https://download.is.tue.mpg.de/download.php?domain=soma&sfile=smpl-fast-derivatives.tar.bz2)
into your python site-packages folder, i.e. ````anaconda3/envs/soma/lib/python3.7/site-packages````.
The final directory should look like ````anaconda3/envs/soma/lib/python3.7/site-packages/psbody/smpl````.
Install the psbody.mesh library following the instructions in [https://github.com/MPI-IS/mesh](https://github.com/MPI-IS/mesh).

The problem doing this is that the folder structure ends up like:

<path to env>/lib/python3.7/site-packages/
├─ psbody/
│  └─ smpl/
├─ psbody_mesh-0.4-py3.7-linux-x86_64.egg/
│  ├─ EGG-INFO/
│  └─ psbody/
│     └─ mesh/

Python can't find smpl because it only looks in the indexed psbody_mesh-(...) folder, not in the manually copied one.

The solution is to paste the smpl folder inside the psbody_mesh-(...)/psbody folder after installing mesh, having the structure as:

<path to env>/lib/python3.7/site-packages/
├─ psbody_mesh-0.4-py3.7-linux-x86_64.egg/
│  ├─ EGG-INFO/
│  └─ psbody/
│     ├─ mesh/
│     └─ smpl/

hand32 commented

After copy psbody into the site-packages directory, follow the instruction at https://github.com/MPI-IS/mesh to setup the package.

  1. $ sudo apt-get install libboost-dev
  2. BOOST_INCLUDE_DIRS=/path/to/boost/include make all

It'll be solve the 'ModuleNotFoundError', merging psbody.mesh into psbody.
Do not run setup.py of psbody/mesh manually.