目录
报错 cannot import name 'get_root_logger':
报错2 ModuleNotFoundError: No module named 'mmcv.runner'
2024.08.30测试,mmdet安装时不能自动安装mmcv。
mmseg安装:
pip install mmsegmentation
引用:
import mmseg
依赖mmcv-full
assert (mmcv_min_version <= mmcv_version < mmcv_max_version), \
f'MMCV=={mmcv.__version__} is used but incompatible. ' \
f'Please install mmcv>=2.0.0rc4.'
报错 cannot import name 'get_root_logger':
File "E:\project\depth\point_Completion\CompletionFormer-main\src\model\pvt.py", line 8, in <module>
from mmseg.utils import get_root_logger
ImportError: cannot import name 'get_root_logger' from 'mmseg.utils' (D:\ProgramData\miniconda3\lib\site-packages\mmseg\utils\__init__.py)
解决方法:
import logging
logger = logging.getLogger()
报错2 ModuleNotFoundError: No module named 'mmcv.runner'
from mmcv.runner import load_checkpoint
ModuleNotFoundError: No module named 'mmcv.runner'
解决方法:
python.exe -m pip install --upgrade pip
pip install mmcv-full
安装MMCV和MMDET 测试成功
2024.08.30测试,mmdet安装时不能自动安装mmcv。
pip install mmdet
mmcv windows,2024.08.30 安装成功:
1.打开用vs2019的x64命令行:
2. conda activate py310
3. set DISTUTILS_USE_SDK=1
4. pip install mmcv==2.1.0
顺序不能变,变了就安装失败。
如下是安装最新版 mmcv-full
的命令
pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/{cu_version}/{torch_version}/index.html
比如:
pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu113/torch1.12.0/index.html
也可以参考这一篇:
ModuleNotFoundError: No module named ‘mmcv._ext‘_AI视觉网奇的博客-CSDN博客
win10上可以,服务器上没成功
'mmdet\ops\nms\src/soft_nms_cpu.pyx' doesn't match any files
2021.06.07报错:
File "E:\project\shibie\insightface-master\detection\scrfd\mmdet\datasets\pipelines\loading.py", line 7, in <module>
from mmdet.core import BitmapMasks, PolygonMasks
ImportError: cannot import name 'BitmapMasks' from 'mmdet.core' (E:\project\shibie\insightface-master\detection\scrfd\mmdet\core\__init__.py)
我的解决方法:
pip install mmdet 自动安装mmcv
win10上可以,服务器上没成功
这个没试过:
2. mmcv
pip install mmcv-full
3. mmdetection
git clone https://github.com/open-mmlab/mmdetection.git
cd mmdetection
pip install -r requirements/build.txt
pip install -v -e . # or "python setup.py develop"