mmpose icon indicating copy to clipboard operation
mmpose copied to clipboard

ModuleNotFoundError: No module named 'mmpose'

Open Taylorminer opened this issue 1 year ago • 3 comments

I can import mmpose successfully. But when I run the demo " python demo/body3d_multiview_detect_and_regress_img_demo.py \

configs/body/3d_kpt_mview_rgb_img/voxelpose/panoptic/voxelpose_prn64x64x64_cpn80x80x20_panoptic_cam5.py \
https://download.openmmlab.com/mmpose/body3d/voxelpose/voxelpose_prn64x64x64_cpn80x80x20_panoptic_cam5-545c150e_20211103.pth \
--out-img-root vis_results \
--camera-param-file tests/data/panoptic_body3d/demo/camera_parameters.json \
--visualize-single-view

" It shows that : Traceback (most recent call last): File "demo/body3d_multiview_detect_and_regress_img_demo.py", line 17, in from mmpose.apis.inference import init_pose_model ModuleNotFoundError: No module named 'mmpose'

And I try the other demo python demo/body3d_two_stage_img_demo.py \

configs/body/3d_kpt_sview_rgb_img/pose_lift/h36m/simplebaseline3d_h36m.py \
https://download.openmmlab.com/mmpose/body3d/simple_baseline/simple3Dbaseline_h36m-f0ad73a4_20210419.pth \
--json-file tests/data/h36m/h36m_coco.json \
--img-root tests/data/h36m \
--camera-param-file tests/data/h36m/cameras.pkl \
--only-second-stage \
--out-img-root vis_results \
--rebase-keypoint-height \
--show-ground-truth

It shows that: Traceback (most recent call last): File "demo/body3d_two_stage_img_demo.py", line 11, in from mmpose.apis import (inference_pose_lifter_model, ModuleNotFoundError: No module named 'mmpose'

It seems that it can't find the folder mmpose, but there is mmpose folder.

Taylorminer avatar Aug 03 '22 08:08 Taylorminer

Hi, @Taylorminer this may be related to the installation of mmpose. What is the command you run to install mmpose?

Or, you can run pip list | grep mmpose to see the installation information of mmpose.

BTW, This issue seems to be deplicate with #1532 , #1533, #1534, #1535.

liqikai9 avatar Aug 03 '22 09:08 liqikai9

I install mmpose by the guide "Best Practices". After I run "pip list | grep mmpose", there is no information output in the terminal. I am sorry for the deplicated issues. The Internet is unstable just now

Taylorminer avatar Aug 03 '22 09:08 Taylorminer

I see. You can try add this line PYTHONPATH="$(dirname $0)/..":$PYTHONPATH in the very begining of your command, for example:

PYTHONPATH="$(dirname $0)/..":$PYTHONPATH python demo/body3d_two_stage_img_demo.py \
configs/body/3d_kpt_sview_rgb_img/pose_lift/h36m/simplebaseline3d_h36m.py \
https://download.openmmlab.com/mmpose/body3d/simple_baseline/simple3Dbaseline_h36m-f0ad73a4_20210419.pth \
--json-file tests/data/h36m/h36m_coco.json \
--img-root tests/data/h36m \
--camera-param-file tests/data/h36m/cameras.pkl \
--only-second-stage \
--out-img-root vis_results \
--rebase-keypoint-height \
--show-ground-truth

And see if this work.

Possibly, I assume that mmpose was not installed appropriately. You can try to reinstall it according to this: https://mmpose.readthedocs.io/en/latest/install.html#best-practices.

liqikai9 avatar Aug 03 '22 11:08 liqikai9

you need run pip uninstall mmpose and mim install mmpose

1172274374 avatar Aug 30 '23 08:08 1172274374