FYI issues and solutions

#13
by shirubei - opened

Thanks for opening source.
Here are issues and solutions I ran into on a clean WSL (Ubuntu 22.04) env

1 ffmpeg needed
==> sudo apt install ffmpeg

2 sh: 1: python: not found
==> sudo ln -s /usr/bin/python3 /usr/bin/python

3 File "/home/roby/.local/lib/python3.10/site-packages/igraph/io/files.py", line 223, in _construct_graph_from_pickle_file
raise IOError(
OSError: Cannot load file. If fname is a file name, that filename may be incorrect.
==> Found this discussion helpful : https://huggingface.co/spaces/H-Liu1997/TANGO/discussions/9#6710f04c79b74b94311dd7d4 ,
but didn't solve this problem completely(get another error: module 'mmcv' has no attribute 'version').
Here's how I worked it out.

Modified app.py at SMPLER-X, line 21 according to above discussion.
In my case, changed to code below(M.mn is version of your Python installation, say 3.10)
os.system('cp -rf ./assets/conversions.py /home/{username}/.local/lib/python{M.mn}/site-packages/torchgeometry/core/conversions.py')

And run these cmds:
pip uninstall mmcv
pip install -U openmim
mim install mmcv==2.1.0

4 ImportError: cannot import name 'bool' from 'numpy'
==> pip install numpy==1.23

5 ModuleNotFoundError: No module named 'mmpose.core.visualization'
==> run these cmds:
cd /home/{username}/.local/lib/python{M.mn}/site-packages/mmpose/core/
mkdir visualization
cd visualization
cp Tango/SMPLer-X/main/transformer_utils/mmpose/core/visualization/. .

6 ImportError: cannot import name 'imshow_bboxes' from 'mmpose.core' (/home/{username}/.local/lib/python{M.mn}/site-packages/mmpose/core/init.py)
==>Modified /home/{username}/.local/lib/python{M.mn}/site-packages/mmpose/models/detectors/top_down.py
from mmpose.core import imshow_bboxes, imshow_keypoints changed to
from mmpose.core.visualization.image import imshow_bboxes, imshow_keypoints

7 ModuleNotFoundError: No module named 'models.jointembedding_high_env0'; 'models' is not a package
==>
Adding these lines below at the beging of Tango/App.py:
import sys
import os

current_dir = os.getcwd()

for root, dirs, files in os.walk(current_dir):
sys.path.insert(0, root)
sys.path.insert(0, os.path.abspath(os.path.dirname(file)))

And add a 0 Bytes file of name "init.py" under models

For installing PyTorch 2.0.0 on Ubuntu 22.04, check this:
Instructions for CUDA v11.8 and cuDNN 8.7 installation on Ubuntu 22.04 for PyTorch 2.0.0( https://gist.github.com/MihailCosmin/affa6b1b71b43787e9228c25fe15aeba )

Thanks for this!

With this guide I got this app to work on Windows too. There are also few code modifications that needs to be done for Windows. Mostly the Linux copy commands.
For example the code in app.py at SMPLER-X:

import os
import shutil

src = './assets/conversions.py'
dst_dir = r'C:\Users\YOUR_USERNAME\miniconda3\envs\tango\Lib\site-packages\torchgeometry\core'

shutil.copy(src, os.path.join(dst_dir, 'conversions.py'))

Sign up or log in to comment