zhiqic / KeyPosS

[ACM MM 2023] KeyPosS: Plug-and-Play Facial Landmark Detection through GPS-Inspired True-Range Multilateration
9 stars 0 forks source link

ImportError: cannot import name 'inference_top_down_pose_model' from 'mmpose.apis' #2

Open HeChengHui opened 1 year ago

HeChengHui commented 1 year ago
mmcv                      2.0.1                    pypi_0    pypi
mmdet                     3.1.0                    pypi_0    pypi
mmengine                  0.8.4                    pypi_0    pypi
mmpose                    1.1.0                    pypi_0    pypi
torch                     2.0.1+cu117              pypi_0    pypi
torchaudio                2.0.2+cu117              pypi_0    pypi
torchmetrics              0.11.4                   pypi_0    pypi
torchvision               0.15.2+cu117             pypi_0    pypi

Exception has occurred: ImportError (note: full exception trace is shown but execution is paused at: _run_module_as_main) cannot import name 'inference_top_down_pose_model' from 'mmpose.apis' (D:\CH\Anaconda\envs\KeyPosS\lib\site-packages\mmpose\apis__init__.py) File "D:\CH\Projects\Driver State Detection\testing\me\Fabian\facial landmarks\KeyPosS\demo\face_video_demo_CH.py", line 9, in from mmpose.apis import (inference_top_down_pose_model, init_pose_model, File "D:\CH\Anaconda\envs\KeyPosS\Lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "D:\CH\Anaconda\envs\KeyPosS\Lib\runpy.py", line 196, in _run_module_as_main (Current frame) return _run_code(code, main_globals, None, ImportError: cannot import name 'inference_top_down_pose_model' from 'mmpose.apis' (D:\CH\Anaconda\envs\KeyPosS\lib\site-packages\mmpose\apis__init__.py)

Please advice on the above error

zhiqic commented 1 year ago

The error message you've encountered indicates an ImportError while trying to import the inference_top_down_pose_model from the mmpose.apis module. The error suggests that there's an incompatibility between the version of mmpose you have installed and the code you are running. To address this issue, follow these steps:

  1. Downgrade mmpose to version 0.29: To match the requirements of your code, you should downgrade the mmpose package to version 0.29.

  2. Downgrade PyTorch: Ensure that your PyTorch version is compatible with mmpose 0.29.

By downgrading both mmpose and PyTorch to the specified versions, you should resolve the ImportError issue.