Ubuntu安装pytorch和mmdetection

1.首先新建conda虚拟环境,安装pytorch

mmdetection不推荐1.11.0版本的torch

pytorch官方中torch历史版本:https://pytorch.org/get-started/previous-versions/

conda create -n mmdet python=3.7

查看conda环境

conda info --env

在这里插入图片描述
安装pytorch

conda install pytorch==1.8.0 torchvision==0.9.0 torchaudio==0.8.0 cudatoolkit=11.1 -c pytorch -c conda-forge

2.安装mmcv-full

mmdetection中文文档:
https://mmdetection.readthedocs.io/zh_CN

pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/{cu_version}/{torch_version}/index.html

这里的cu_version和torch_version是根据自己版本而定的,不清楚的可以看下面这个网址:
https://gitee.com/cubone/mmcv
根据上面安装的pytorch版本,我的mmcv-full安装指令如下:

pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu111/torch1.8.0/index.html

3.下载、编译、安装mmdetection

首先,安装git

conda install git

安装mmdetection

git clone https://github.com/open-mmlab/mmdetection.git
cd mmdetection
pip install -r requirements/build.txt
pip install -v -e .  # or "python setup.py develop"

若服务器不能翻墙,就从本机上下载后传到服务器即可

4.测试

python tools/train.py -h

在这里插入图片描述

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值