我尝试在 SCRFD 中使用 mmdet 和 mmcv 进行人脸检测并面临此错误:
mmcv_version = digit_version(mmcv.__version__)
AttributeError: module 'mmcv' has no attribute '__version__'
有没有小伙伴遇到过这个错误?
我找到了答案:
适用于火炬 1.8 :
pip3 install mmcv-full==1.3.15 -f https://download.openmmlab.com/mmcv/dist/cu111/torch1.8.0/index.html
这个命令对我有用
对于CPU版本:
pip3 install mmcv-full==1.3.17 -f https://download.openmmlab.com/mmcv/dist/cpu/torch1.8.0/index.html
这对我有用!
对于那些在 torch>=2.0.0 上遇到此问题的人,mmcv 代码已更改,如下所述:https://github.com/open-mmlab/mmcv/blob/2e44eaeba36b3f4c304e830053fc2660d8407afb/docs/en/get_started/api_reference.md #L164
因此,您需要更改任何 mmcv 导入以匹配该新版本。