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输入法不见了的解决方法