3090卡torch,mmcv,mmdetection环境配置 全宇宙最好

本文

本文堪称全宇宙最好的安装教程!(就是吹吹牛逼呢)
安装这个环境其实很简单,就三步: 显卡驱动 —— cuda —— torch, 安装过程中,注意版本对应就可以。

显卡驱动

sudo apt install nvidia-driver-460(如果说这里无法切换驱动)

cuda版本


下载链接
https://developer.nvidia.com/cuda-toolkit-archive

设置环境变量
就是在.bashrc中把这个加进去就行
export PATH=/usr/local/cuda/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
cudnn
如果要装cudnn的话(不是必要的)
https://developer.nvidia.com/rdp/cudnn-archive
在该网页中找到适配所用cuda的cudnn包,解压copy到cuda对应的头文件和库文件路径即可。

cudnn的好处,其GPU加速作用;
加速开关的代码为:
torch.backends.cudnn.benchmark = True

torch


torch下载说明
https://pytorch.org/get-started/previous-versions/
通常,使用pip安装就可以;

mmcv 注意要素
https://mmcv.readthedocs.io/en/latest/get_started/installation.html

mmdetection
https://mmdetection.readthedocs.io/en/latest/get_started.html#installation

原文地址:https://www.cnblogs.com/yubo455/p/15582839.html