GeForce RTX 3070安装mmdetection
GeForce RTX 3070安装mmdetection
首先介绍一下环境:电脑系统为Ubuntu20.04,显卡驱动号为460.73.01,Cuda为11.0,pytorch版本为1.7.1,python为3.7,显卡是GeForce RTX 3070。
我想要使用mmdetection来进行图像方面的研究,在安装的过程中出现了些许问题,就此记录一下,防止自己忘记。
首先我按照mmdetection官网的教程(mmdetection官网教程)进行操作,当运行到第三步时,出现了错误nvcc fatal : Unsupported gpu architecture ‘compute_86‘,我上英伟达的网站(显卡对应算力表)看到显卡对应的算力表,RTX3070算力为8.6。我找到为什么会出现nvcc出错的原因了,但是我看了也不是特别懂(具体解释在mmdetection官方文档)。由此,我按照官方的教程算是安装上了mmdetection。下面写一下我的整体过程,该过程就是按照官方网站的过程走的:
1、首先用conda安装了一个名字为mmdetection 的虚拟环境,python我安装了3.7版本:
2、然后安装了1.7.1版本的pytorch(pytorch官方安装链接)
conda install pytorch==1.7.1 torchvision==0.8.2 torchaudio==0.7.2 cudatoolkit=11.0 -c pytorch3、因为我显卡为RTX3070,算力为8.6,所以我没有直接用这个代码:pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu110/torch1.7.1/index.html
而是使用了官方教程中提供的第二种方法,代码如下:
为什么这样做,看我上面贴的mmdetection官方文档。
4、克隆mmdetection的库并且安装mmdetection:
最后进行一下验证是否安装成功。在mmdetection官网教程最下面给出了验证代码:
from mmdet.apis import init_detector, inference_detectorconfig_file = 'configs/faster_rcnn/faster_rcnn_r50_fpn_1x_coco.py' # download the checkpoint from model zoo and put it in `checkpoints/` # url: http://download.openmmlab.com/mmdetection/v2.0/faster_rcnn/faster_rcnn_r50_fpn_1x_coco/faster_rcnn_r50_fpn_1x_coco_20200130-047c8118.pth checkpoint_file = 'checkpoints/faster_rcnn_r50_fpn_1x_coco_20200130-047c8118.pth' device = 'cuda:0' # init a detector model = init_detector(config_file, checkpoint_file, device=device) # inference the demo image inference_detector(model, 'demo/demo.jpg') print("finish")我加了最后一行print来看看是否程序结束,我运行的结果为:
Use load_from_local loader /home/ws/wmyProjects/a-seg/mm-test/mmdetection/mmdet/datasets/utils.py:68: UserWarning: "ImageToTensor" pipeline is replaced by "DefaultFormatBundle" for batch inference. It is recommended to manually replace it in the test data pipeline in your config file.'data pipeline in your config file.', UserWarning) finish出现了一个警告,然后我去mmdetection官方文档查了一下,具体解释为这个,于是我修改了mmdetection->configs->base->datasets->coco_detection.py中的代码,按照官方文档进行修改,于是就没有警告了。
就此RTX3070安装就此结束了,希望我可以尽快熟悉这个,能够在这个基础上跑实验,这也是第一次写博客,写的也不太好。继续加油吧!
总结
以上是生活随笔为你收集整理的GeForce RTX 3070安装mmdetection的全部内容,希望文章能够帮你解决所遇到的问题。
- 上一篇: 第2期:网页动画制作(CSS+JS)
- 下一篇: xp输入法不见了的解决方法