WIN10+cuda10.2+pytorch1.1+VS2015+conda3-5.3.1
参考文档:
总:https://github.com/YDS-FOREVER/CenterNet-windows/blob/master/readme/INSTALL.md
https://blog.csdn.net/sinat_29634715/article/details/102609876
https://blog.csdn.net/yangdashi888/article/details/103178870
- 下载安装cuda
cuda: https://developer.nvidia.com/cuda-downloads
安装完之后使用nvcc --version测试
如果找不到nvcc.exe, 需要将路径加入PATH. (默认是: C:Program FilesNVIDIA GPU Computing ToolkitCUDAv10.2in)
-
安装visualcppbuildtools_full.exe(内网65对ftp也有)
联网在线安装,使用VPN进行
-
conda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/
建议参考https://mirror.tuna.tsinghua.edu.cn/help/anaconda/ 进行国内进行镜像的配置. -
进入虚拟环境
conda create -n CenterNet python=3.6
conda activate CenterNet
conda install pytorch==1.1.0 torchvision cudatoolkit=10.0 -c pytorch
git clone https://github.com/xingyizhou/CenterNet.git
cd CenterNet
pip install -r requirements.txt
4. 在线部署cocoapi
pip install git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI
5. 编译DCNv2
git clone https://github.com/CharlesShang/DCNv2
#DCNv2文件夹替换CenterNetsrclibmodels
etworksDCNv2文件夹
#修改 DCN文件2srccudadcn_v2_cuda.cu
#//extern THCState *state; #注释
##THCState *state = at::globalContext().lazyInitCUDA(); // 添加该行
cd CenterNetsrclibmodels
etworksDCNv2
python setup.py build develop
#可能需要下载模型,没有的话