虚拟机ubuntu18.04 cpu 安装 mmdetection

虚拟机ubuntu18.04 cpu 安装 mmdetection

安装:

  1. 安装依赖,我的机器上安装的python3.6、

  2. torch-1.5.1+cpu-cp36-cp36m-linux_x86_64.whl
    numpy-1.19.0-cp36-cp36m-manylinux1_x86_64.whl、
    torchvision-0.6.1+cpu-cp36-cp36m-linux_x86_64.whl、
    sudo pip3 install numpy-1.19.0-cp36-cp36m-manylinux1_x86_64.whl
    sudo pip3 install torch-1.5.1+cpu-cp36-cp36m-linux_x86_64.whl
    sudo pip3 install torchvision-0.6.1+cpu-cp36-cp36m-linux_x86_64.whl

  3. 安装 matplotlib
    sudo pip3 insatll matplotlib -i https://pypi.tuna.tsinghua.edu.cn/simple

  4. 安装 cython
    sudo pip3 install cython -i https://pypi.tuna.tsinghua.edu.cn/simple

  5. 安装mmcv
    sudo pip3 install mmcv -i https://pypi.tuna.tsinghua.edu.cn/simple

  6. 安装pycocotools, 如果不安装测试的时候会报错
    sudo pip install pycocotools

  7. 下载 mmdetection 源码 下载较慢可以使用码云下载
    git clone https://github.com/open-mmlab/mmdetection.git
    cd mmdetection
    pip install -r requirements/build.txt

pip install “git+https://github.com/openmmlab/cocoapi.git#subdirectory=pycocotools”
原因 墙了,国外访问链接失败
解决方法
pip install “git+https://gitee.com/wsyin/cocoapi.git#subdirectory=PythonAPI”

pip install -v -e . # or “python setup.py develop”

  1. 在执行python setup.py develop遇见gcc版本造成的错误。使用gcc7.4.0, gcc6.5.0均不能正常执行,后改为gcc5.5.0解决该问题,原因不详,大家可以直接使用官方测试过的gcc版本:4.9/5.3/5.4/7.3。
    gcc安装及版本转化如下(以gcc7转gcc5为例):

首先查看自己的gcc版本,Ubuntu18.04上默认的是7.3版本

gcc --version
gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0
Copyright © 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

下载gcc/g++ 5
sudo apt-get install -y gcc-5
sudo apt-get install -y g+±5

链接gcc/g++实现降级
cd /usr/bin
sudo rm gcc
sudo ln -s gcc-5 gcc
sudo rm g++
sudo ln -s g+±5 g++

再次查看gcc版本,可以看到已经降级

gcc --version
gcc (Ubuntu 5.5.0-12ubuntu1) 5.5.0 20171010
Copyright © 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值