一、介绍
QueryDet是一个由粗到细不断精细化的小目标检测算法,链接为https://github.com/ChenhongyiYang/QueryDet-PyTorch。
二、官方的安装过程与提醒
官方测试环境为 CUDA 10.2,但实际上没有那么严苛,我使用的 CUDA 11.3,可以正常跑通,但是由于spconv最高只支持 CUDA 12.0,所以高于12.0的版本可能就不支持了。本节是官方的安装过程,第三节是我配置的环境,可以作为一个参考。
1.安装python
conda create -n querydet python=3.7 -y
首先安装python环境,可能由于python 3.7 版本有点老,运行时会报错,显示“需要更新setuptools”。如果出现了这个问题,按照报错信息搜索就可以找到解决方法。
2.安装torch
pip install torch==1.8.1+cu101 torchvision==0.9.1+cu101 -f https://download.pytorch.org/whl/torch_stable.html
3.安装detectron2
python -m pip install detectron2==0.4 -f https://dl.fbaipublicfiles.com/detectron2/wheels/cu102/torch1.7/index.html
detectron2不仅支持官方推荐的,也可以安装其它版本,但是一定要和 torch 版本匹配,查看 https://detectron2.readthedocs.io/en/latest/tutorials/install.html
4.安装spconv
pip install spconv-cu102==2.1.25
spconv要和 cuda 版本匹配,所有支持的 cuda 版本和对应的安装指令如下。
三、我配置的环境
cuda:11.4
detectron2:0.6+cu113
pycocotools:2.0.7
spconv-cu113 :2.3.6
torch :1.10.0