文章日期2022/04/24
参照官网文档mmdetection/MMDet_Tutorial.ipynb at master · open-mmlab/mmdetection · GitHub
在colab中默认的配置查看
import torch, torchvision
print(torch.__version__, torch.cuda.is_available())
输出结果是1.10.0+cu111 True
因此要把官网中的文档mmcv的安装链接进行更改为torch1.10.0 后续可能会更新要保证版本对应
!pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu111/torch1.10.0/index.html
# Install mmdetection
!rm -rf mmdetection
!git clone https://github.com/open-mmlab/mmdetection.git
%cd mmdetection
!pip install -e .
再次输入
# Check Pytorch installation
import torch, torchvision
print(torch.__version__, torch.cuda.is_available())
# Check MMDetection installation
import mmdet
print(mmdet.__version__)
# Check mmcv installation
from mmcv.ops import get_compiling_cuda_version, get_compiler_version
print(get_compiling_cuda_version())
print(get_compiler_version())
如果正常输出
1.10.0+cu111 True 2.23.0 11.1 GCC 7.3没有报错,则配置成功
需要注意每次打开colab都需要进行这一步的配置。
在本地配置时可以直接通过pip安装opencv,亲测不会报错。
但是在运行时又多线程导致的pipeline error,这时需要设置来保证dataloder的num参数为0。
cfg.data.workers_per_gpu = 0
后续可能会出配置文件的教程