mmdetection在colab上的配置

文章日期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

后续可能会出配置文件的教程

  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值