Ubuntu安装pytorch和mmdetection

Ubuntu安装pytorch和mmdetection,第1张

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

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/578965.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-04-11
下一篇 2022-04-11

发表评论

登录后才能评论

评论列表(0条)

保存