我打算用mmpose进行人体姿态识别,一开始mmcv版本不对,后来所有东西都配置好之后出现下面几个问题:
遇到的错误表明在加载 mmcv 的扩展模块时失败了,这可能是因为以下几个原因:
1 缺少依赖:可能缺少一些系统库或依赖库。
2DLL 文件问题:可能是由于 DLL 文件缺失或不匹配。
3 Python 版本和环境问题:环境中可能存在 Python 版本或库不兼容的问题。
这是报错代码
(dwpose) PS F:\DWPOSE> python F:\DWPOSE\DWPose-onnx\mmpose\demo\image_demo.py video\img1.jpg F:\DWPOSE\DWPose-onnx\mmpose\ceshi\configs\td-hm_hrnet-w48_8xb32-210e_coco-256x192.py F:\DWPOSE\DWPose-onnx\mmpose\ceshi\configs\td-hm_hrnet-w48_8xb32-210e_coco-256x192-0e67c616_20220913.pth --out-file vis_results.jpg --draw-heatmap
C:\Users\ssx\AppData\Roaming\Python\Python38\site-packages\mmengine\optim\optimizer\zero_optimizer.py:11: DeprecationWarning: TorchScript support for functional optimizers is deprecated and will be removed in a future PyTorch release. Consider using the torch.compile optimizer instead.
from torch.distributed.optim import \
C:\Users\ssx\AppData\Roaming\Python\Python38\site-packages\mmcv\cnn\bricks\transformer.py:33: UserWarning: Fail to import `MultiScaleDeformableAttention from mmcv.ops.multi_scale_deform_attn, You should install mmcv rather than mmcv-lite if you need this module.
warnings.warn('Fail to import `MultiScaleDeformableAttention from '
Traceback (most recent call last):
File "F:\DWPOSE\DWPose-onnx\mmpose\demo\image_demo.py", line 6, in <module>
from mmpose.apis import inference_topdown, init_model
File "C:\Users\ssx\AppData\Roaming\Python\Python38\site-packages\mmpose\apis\__init__.py", line 2, in <module>
from .inference import (collect_multi_frames, inference_bottomup,
File "C:\Users\ssx\AppData\Roaming\Python\Python38\site-packages\mmpose\apis\inference.py", line 17, in <module>
from mmpose.models.builder import build_pose_estimator
File "C:\Users\ssx\AppData\Roaming\Python\Python38\site-packages\mmpose\models\__init__.py", line 8, in <module>
from .heads import * # noqa
File "C:\Users\ssx\AppData\Roaming\Python\Python38\site-packages\mmpose\models\heads\__init__.py", line 11, in <module>
from .transformer_heads import EDPoseHead
File "C:\Users\ssx\AppData\Roaming\Python\Python38\site-packages\mmpose\models\heads\transformer_heads\__init__.py", line 2, in <module>
from .edpose_head import EDPoseHead
File "C:\Users\ssx\AppData\Roaming\Python\Python38\site-packages\mmpose\models\heads\transformer_heads\edpose_head.py", line 14, in <module>
from mmcv.ops import MultiScaleDeformableAttention
File "C:\Users\ssx\AppData\Roaming\Python\Python38\site-packages\mmcv\ops\__init__.py", line 3, in <module>
from .active_rotated_filter import active_rotated_filter
File "C:\Users\ssx\AppData\Roaming\Python\Python38\site-packages\mmcv\ops\active_rotated_filter.py", line 10, in <module>
ext_module = ext_loader.load_ext(
File "C:\Users\ssx\AppData\Roaming\Python\Python38\site-packages\mmcv\utils\ext_loader.py", line 13, in load_ext
ext = importlib.import_module('mmcv.' + name)
File "F:\Anaconda\envs\dwpose\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: DLL load failed while importing _ext: 找不到指定的程序。