GeForce RTX 3070安装mmdetection
GeForce RTX 3070安裝mmdetection
首先介紹一下環(huán)境:電腦系統(tǒng)為Ubuntu20.04,顯卡驅(qū)動(dòng)號(hào)為460.73.01,Cuda為11.0,pytorch版本為1.7.1,python為3.7,顯卡是GeForce RTX 3070。
我想要使用mmdetection來進(jìn)行圖像方面的研究,在安裝的過程中出現(xiàn)了些許問題,就此記錄一下,防止自己忘記。
首先我按照mmdetection官網(wǎng)的教程(mmdetection官網(wǎng)教程)進(jìn)行操作,當(dāng)運(yùn)行到第三步時(shí),出現(xiàn)了錯(cuò)誤nvcc fatal : Unsupported gpu architecture ‘compute_86‘,我上英偉達(dá)的網(wǎng)站(顯卡對(duì)應(yīng)算力表)看到顯卡對(duì)應(yīng)的算力表,RTX3070算力為8.6。我找到為什么會(huì)出現(xiàn)nvcc出錯(cuò)的原因了,但是我看了也不是特別懂(具體解釋在mmdetection官方文檔)。由此,我按照官方的教程算是安裝上了mmdetection。下面寫一下我的整體過程,該過程就是按照官方網(wǎng)站的過程走的:
1、首先用conda安裝了一個(gè)名字為mmdetection 的虛擬環(huán)境,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、因?yàn)槲绎@卡為RTX3070,算力為8.6,所以我沒有直接用這個(gè)代碼:pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu110/torch1.7.1/index.html
而是使用了官方教程中提供的第二種方法,代碼如下:
為什么這樣做,看我上面貼的mmdetection官方文檔。
4、克隆mmdetection的庫并且安裝mmdetection:
最后進(jìn)行一下驗(yàn)證是否安裝成功。在mmdetection官網(wǎng)教程最下面給出了驗(yàn)證代碼:
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來看看是否程序結(jié)束,我運(yùn)行的結(jié)果為:
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出現(xiàn)了一個(gè)警告,然后我去mmdetection官方文檔查了一下,具體解釋為這個(gè),于是我修改了mmdetection->configs->base->datasets->coco_detection.py中的代碼,按照官方文檔進(jìn)行修改,于是就沒有警告了。
就此RTX3070安裝就此結(jié)束了,希望我可以盡快熟悉這個(gè),能夠在這個(gè)基礎(chǔ)上跑實(shí)驗(yàn),這也是第一次寫博客,寫的也不太好。繼續(xù)加油吧!
總結(jié)
以上是生活随笔為你收集整理的GeForce RTX 3070安装mmdetection的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 第2期:网页动画制作(CSS+JS)
- 下一篇: xp输入法不见了的解决方法