LinDixuan / OmniHands

4 stars 0 forks source link

Setup issues on WSL2 Ubuntu #1

Open W-Nabe opened 3 days ago

W-Nabe commented 3 days ago

Thank you for providing this wonderful project and repository.

I'm encountering some issues during the OmniHands environment setup. I'm using Windows 11 with WSL2 Ubuntu.

Current environment:

python --version
Python 3.10.14
pip show torch
Name: torch
Version: 2.0.1+cu117
Summary: Tensors and Dynamic neural networks in Python with strong GPU acceleration
Home-page: https://pytorch.org/
Author: PyTorch Team
Author-email: packages@pytorch.org
License: BSD-3
Location: /home/nabe/miniconda3/envs/omhand/lib/python3.10/site-packages
Requires: filelock, jinja2, networkx, sympy, triton, typing-extensions
Required-by: torchvision, triton
nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2022 NVIDIA Corporation
Built on Tue_May__3_18:49:52_PDT_2022
Cuda compilation tools, release 11.7, V11.7.64
Build cuda_11.7.r11.7/compiler.31294372_0
sudo update-alternatives --config cuda
There are 2 choices for the alternative cuda (providing /usr/local/cuda).

  Selection    Path                  Priority   Status
------------------------------------------------------------
  0            /usr/local/cuda-12.1   121       auto mode
* 1            /usr/local/cuda-11.7   117       manual mode
  2            /usr/local/cuda-12.1   121       manual mode

Issue 1: Resolved

When I ran:

pip install -e .[all]

I got the following error(error is partial):

[Errno 20] Not a directory: 'hipconfig'

I resolved this by running:

git clone https://github.com/ROCm-Developer-Tools/HIP.git
export PATH=$PATH:path/to/HIP/bin

Issue 2: Probably resolved

When I ran:

python run_demo.py \
    --checkpoint ./checkpoints/Demo_Video.pth \
    --cfg ./checkpoints/config_video.yaml \
    --video_dir ../video/test/ \
    --out_dir ./demo_out \
    --gpu 0 \
    --mode video

I got the following error:

ModuleNotFoundError: No module named 'plyfile'

I resolved this by running:

pip install plyfile

Issue 3: Probably resolved

When I ran the same command again:

python run_demo.py \
    --checkpoint ./checkpoints/Demo_Video.pth \
    --cfg ./checkpoints/config_video.yaml \
    --video_dir ./video/test/ \
    --out_dir ./demo_out \
    --gpu 0 \
    --mode video

I got the following error:

ModuleNotFoundError: No module named 'mano'

I resolved this by running:

pip install mano

Issue 4: I'm stuck here

When I ran the same command again:

python run_demo.py \
    --checkpoint ./checkpoints/Demo_Video.pth \
    --cfg ./checkpoints/config_video.yaml \
    --video_dir ./video/test/ \
    --out_dir ./demo_out \
    --gpu 0 \
    --mode video

I got the following error:

Traceback (most recent call last):
  File "/home/nabe/OmniHands/run_demo.py", line 20, in <module>
    from hands_multiview.models import load_from_ckpt as load_multi
  File "/home/nabe/OmniHands/hands_multiview/models/__init__.py", line 2, in <module>
    from .Hands_Multi import Hands_Multi
  File "/home/nabe/OmniHands/hands_multiview/models/Hands_Multi.py", line 25, in <module>
    from ..datasets.relighted_mano import MANO as rel_mano
  File "/home/nabe/OmniHands/hands_multiview/datasets/__init__.py", line 23, in <module>
    from .dexycb_multi import DexYCB_Temporal_Twohand
  File "/home/nabe/OmniHands/hands_multiview/datasets/dexycb_multi.py", line 20, in <module>
    from .manolayer_dexycb import ManoLayer
  File "/home/nabe/OmniHands/hands_multiview/datasets/manolayer_dexycb.py", line 7, in <module>
    from mano.webuser.smpl_handpca_wrapper_HAND_only import ready_arguments
  File "/home/nabe/miniconda3/envs/omhand/lib/python3.10/site-packages/mano/__init__.py", line 31, in <module>
    locale.setlocale(locale.LC_ALL, LOCALE)
  File "/home/nabe/miniconda3/envs/omhand/lib/python3.10/locale.py", line 620, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting

I'm not sure how to resolve this error.

The files Demo_Video.pth, Demo_Image.pth, Demo_Multiview.pth, and Eval_Video.pth are located in /home/nabe/OmniHands/checkpoints.

The files MANO_RIGHT.pkl and MANO_LEFT.pkl are located in /home/nabe/OmniHands/_DATA/data/mano. (I suspect this might be incorrect).

Could you please advise on how to resolve this issue?

W-Nabe commented 2 days ago

Update on Issue 4: The locale error was successfully resolved by running

sudo dpkg-reconfigure locales

and enabling en_US.UTF-8 UTF-8.

Issue 5:

After resolving the locale error, running the same command:

python run_demo.py \
    --checkpoint ./checkpoints/Demo_Video.pth \
    --cfg ./checkpoints/config_video.yaml \
    --video_dir ./video/test/ \
    --out_dir ./demo_out \
    --gpu 0 \
    --mode video

resulted in a new error:

Traceback (most recent call last):
  File "/home/nabe/OmniHands/run_demo.py", line 20, in <module>
    from hands_multiview.models import load_from_ckpt as load_multi
  File "/home/nabe/OmniHands/hands_multiview/models/__init__.py", line 2, in <module>
    from .Hands_Multi import Hands_Multi
  File "/home/nabe/OmniHands/hands_multiview/models/Hands_Multi.py", line 25, in <module>
    from ..datasets.relighted_mano import MANO as rel_mano
  File "/home/nabe/OmniHands/hands_multiview/datasets/__init__.py", line 23, in <module>
    from .dexycb_multi import DexYCB_Temporal_Twohand
  File "/home/nabe/OmniHands/hands_multiview/datasets/dexycb_multi.py", line 20, in <module>
    from .manolayer_dexycb import ManoLayer
  File "/home/nabe/OmniHands/hands_multiview/datasets/manolayer_dexycb.py", line 7, in <module>
    from mano.webuser.smpl_handpca_wrapper_HAND_only import ready_arguments
ModuleNotFoundError: No module named 'mano.webuser'

The files MANO_RIGHT.pkl and MANO_LEFT.pkl are still located in /home/nabe/OmniHands/_DATA/data/mano.

Currently, I'm still unsure how to resolve the issue. I'm not very familiar with this area, so I'm trying to find solutions by asking AI and searching online, but I'm mostly making educated guesses.

W-Nabe commented 2 days ago

Update on Issue 5:

pip uninstall mano
git clone https://github.com/hassony2/manopth.git
cd manopth
pip install -e .
cd ../

This resolved the ModuleNotFoundError: No module named 'mano.webuser' error. However, (I'm unsure if this is the correct solution)


Issue 6:

I'm now encountering a new error:

/home/nabe/miniconda3/envs/omhand/lib/python3.10/site-packages/mmcv/cnn/bricks/transformer.py:27: UserWarning: Fail to import ``MultiScaleDeformableAttention`` from ``mmcv.ops.multi_scale_deform_attn``, You should install ``mmcv-full`` if you need this module.
  warnings.warn('Fail to import ``MultiScaleDeformableAttention`` from '
Traceback (most recent call last):
  File "/home/nabe/OmniHands/run_demo.py", line 29, in <module>
    manoData_R = pickle.load(open('/workspace/hamer_twohand/_DATA/data/mano/MANO_RIGHT.pkl', 'rb'), encoding='latin1')
FileNotFoundError: [Errno 2] No such file or directory: '/workspace/hamer_twohand/_DATA/data/mano/MANO_RIGHT.pkl'

I suspect this is because I have MANO_RIGHT.pkl and MANO_LEFT.pkl located in /home/nabe/OmniHands/_DATA/data/mano.

Where should the MANO_RIGHT.pkl and MANO_LEFT.pkl files be placed when working on WSL2?

LinDixuan commented 1 day ago

Thank you for your attention to my work. I apologize that the code has many areas that are still not perfect. I think Issue 5 can be solved by deleting "from .dexycb_multi import DexYCB_Temporal_Twohand" in "/home/nabe/OmniHands/hands_multiview/datasets/init.py", line 23. And Issue 6 can be solved by editing the address in "/home/nabe/OmniHands/run_demo.py", line 29,30 to the address you put the files.

W-Nabe commented 1 day ago

Thank you so much for your quick response! I was really stuck and your advice was a huge help.

As you suggested, I rewrote __init__.py and changed the path in run_demo.py as follows:

# manoData_R = pickle.load(open('/workspace/hamer_twohand/_DATA/data/mano/MANO_RIGHT.pkl', 'rb'), encoding='latin1')
# manoData_L = pickle.load(open('/workspace/hamer_twohand/_DATA/data/mano/MANO_LEFT.pkl', 'rb'), encoding='latin1')
manoData_R = pickle.load(open('/home/nabe/OmniHands/_DATA/data/mano/MANO_RIGHT.pkl', 'rb'), encoding='latin1')
manoData_L = pickle.load(open('/home/nabe/OmniHands/_DATA/data/mano/MANO_LEFT.pkl', 'rb'), encoding='latin1')

After running pip install -e .[all], I noticed that the torch version had become Version: 2.4.1, so I reverted it to Version: 2.0.1+cu117. (I'm not sure if reverting the version was the right decision or if 2.4.1 is acceptable.)

After running the demo, I encountered two errors: ModuleNotFoundError: No module named 'mmpose' and ModuleNotFoundError: No module named 'mmengine'. So, I executed pip install mmpose and pip install mmengine.

Then, I got the following error: AssertionError: MMCV==1.3.9 is used but incompatible. Please install mmcv>=2.0.0rc4, <=3.0.0. So I ran pip install mmcv==2.0.0rc4.

However, I'm a bit concerned about the following warning that appeared:

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
hamer 0.0.0 requires mmcv==1.3.9, but you have mmcv 2.0.0rc4 which is incompatible.

After that, I encountered the error: ModuleNotFoundError: No module named 'mmdet' and executed pip install mmdet.

When I ran the demo again, the following error appeared, and I'm currently stuck here:

Traceback (most recent call last):
  File "/home/nabe/OmniHands/run_demo.py", line 24, in <module>
    from vitpose_model import ViTPoseModel
  File "/home/nabe/OmniHands/vitpose_model.py", line 9, in <module>
    from mmpose.apis import inference_top_down_pose_model, init_pose_model, process_mmdet_results, vis_pose_result
ImportError: cannot import name 'inference_top_down_pose_model' from 'mmpose.apis' (/home/nabe/miniconda3/envs/omhand/lib/python3.10/site-packages/mmpose/apis/__init__.py)

I would appreciate any advice you could offer when you have time.