linux下离线安装mmdetection


前言

离线状态下在Linux中安装mmdetection进行目标检测。

一、查看安装说明文档

1.网址:
https://github.com/openmmlab/mmdetection/blob/master/docs/install.md
查看docs文件夹下的install.md说明文档,查看安装所需环境及其版本。

在这里插入图片描述

这里安装的是anaconda3.8+cuda10.0+torch1.4.0+torchvision0.5.0+mmcv-latest+mmdetection

二、anaconda3.8的下载安装

a. Create a conda virtual environment and activate it.
1.下载网址:https://repo.anaconda.com/archive/
这里有各个版本的anaconda~下载Anaconda3-2020.07-Linux-x86_64.sh。
2.安装:参照“Linux下anaconda3的安装和环境变量的配置进行安装”
网址:https://blog.csdn.net/Granery/article/details/87265764
3.测试
在命令行输入conda,得到如下显示即代表安装成功。
在这里插入图片描述


三、torch1.4.0与torchvision0.5.0的下载安装

b. Install PyTorch and torchvision following the official instructions, e.g.
1.下载网址:https://download.pytorch.org/whl/torch_stable.html
这里有各个版本的pytorch与torchvision~下载cu100/torch-1.4.0%2Bcu100-cp38-cp38-linux_x86_64.whl与cu100/torchvision-0.5.0%2Bcu100-cp38-cp38-linux_x86_64.whl

注意:
一定要安装对应的版本:
其中cu100即cuda版本为10.0,cp38即anaconda版本为3.8,选择linux_x86_64。
torch与torchvision版本对应关系参见:https://blog.csdn.net/younger_to_older/article/details/107827961
否则报错:在这里插入图片描述
2.安装
输入命令:
pip install torch-1.4.0+cu100-cp38-cp38-linux_x86_64.whl
pip install torchvision-0.5.0+cu100-cp38-cp38-linux_x86_64.whl

四、mmcv的下载安装

c. Install mmcv, we recommend you to install the pre-build mmcv as below.
1.下载网址:https://download.openmmlab.com/mmcv/dist/index.html
这里有各个版本的mmcv~下载./latest/torch1.4.0/cu100/mmcv_full-latest+torch1.4.0+cu100-cp38-cp38-manylinux1_x86_64.whl
在这里插入图片描述

2.安装
输入命令:
pip install mmcv_full-latest+torch1.4.0+cu100-cp38-cp38-manylinux1_x86_64.whl

注意: 这个过程中会报很多错,因为mmcv需要很多python库的支撑,其中的一些库我们的anaconda并没有安装。
eg.如下报错意为:没有addict库。
在这里插入图片描述
解决方法:每报一个错就去下载安装对应的python库并输入命令安装,之后输入命令继续尝试安装mmcv,循环进行。
( pip install addict-2.3.0-py3-none-any.whl )
(tar -xzf terminaltables-3.1.0.tar.gz )
( tar -xvf mmpycocotools-12.0.3.tar )
在这个网站可以下载几乎所有的python库: https://pypi.org/
3.测试
输入安装命令后得到如下显示即代表安装成功。
在这里插入图片描述

五、mmdetection的下载安装

e. Install build requirements and then install mmdetection.
1.下载网址:https://github.com/open-mmlab/mmdetection
2.安装
进入mmdetection-master文件夹,输入python setup.py develop命令。

dachuang@node2620:~$ cd mmdetection-master/ 
dachuang@node2620:~/mmdetection-master$ ls        
configs  demo  docker  docs  LICENSE  mmdet  pytest.ini  README.md  requirements  requirements.txt  resources  setup.cfg  setup.py  tests  tools            
dachuang@node2620:~/mmdetection-master$ python setup.py develop                                                                                                                                  

3.与安装mmcv时相同,会缺少很多库,要一直下载安装所需库到不报错~下载网站和命令也是一样的
4.测试
输入安装命令,最后得到如下显示即代表安装成功。
在这里插入图片描述

  • 7
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值