日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

GeForce RTX 3070安装mmdetection

發布時間:2023/12/20 编程问答 49 豆豆
生活随笔 收集整理的這篇文章主要介紹了 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版本:

conda create -n mmdetection python=3.7 conda activate mmdetection

2、然后安裝了1.7.1版本的pytorch(pytorch官方安裝鏈接)

conda install pytorch==1.7.1 torchvision==0.8.2 torchaudio==0.7.2 cudatoolkit=11.0 -c pytorch

3、因為我顯卡為RTX3070,算力為8.6,所以我沒有直接用這個代碼:pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu110/torch1.7.1/index.html
而是使用了官方教程中提供的第二種方法,代碼如下:

git clone https://github.com/open-mmlab/mmcv.git cd mmcv MMCV_WITH_OPS=1 MMCV_CUDA_ARGS='-gencode=arch=compute_80,code=sm_80' pip install -e . cd ..

為什么這樣做,看我上面貼的mmdetection官方文檔。
4、克隆mmdetection的庫并且安裝mmdetection:

git clone https://github.com/open-mmlab/mmdetection.git cd mmdetection pip install -r requirements/build.txt pip install -v -e .

最后進行一下驗證是否安裝成功。在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的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。