mmdetection安装

参考mmdetection中docs/install.md文件,总结安装步骤如下:

  • 1、创建并激活虚拟环境
conda create -n mmdetection python=3.7
conda activate mmdetection
  • 2、安装pytorch、cudatoolkit=10.0、 torchvision(cudatoolkit要与系统上安装的cuda版本匹配)
conda install pytorch cudatoolkit=10.0 torchvision
  • 3、进入到mmdetection文件下,安装其它依赖库
cd mmdetection
python -m pip install -r requirements.txt
  • 4、安装pycocotools

注意:安装pycocotools之前一定要先安装cython,否则会出错

conda install cython

官方给出在线安装命令,如下所示。但是由于网络原因,我们通常会安装失败。

#subdirectory=pycocotools代表安装cocoapi文件内的pycocotools文件

pip install "git+https://github.com/open-mmlab/cocoapi.git#subdirectory=pycocotools"

我们可以使用离线方式进行安装。首先使用gitee镜像下载cocoapi文件,然后打开cocoapi文件,将里面的pycocotools文件夹复制到对应虚拟环境的site-packages路径下,我的路径如下图所示:

执行pycocotools文件下的setup.py脚本,开始离线安装(执行此命令前,最好激活虚拟环境)

python setup.py install
  • 5、安装mmdetection
python setup.py develop

 

参考文章:https://www.cnblogs.com/dyc99/p/12751535.html

                      https://www.zhihu.com/question/331216865

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

进击的路飞桑

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值