Windows10 DCNv2编译

我的环境是,cuda10.1,python3.7,pytorch1.7.1,为了跑FairMOT模型,需要编译DCNv2,在windows上编译报错,最后成功解决。

错误:

RuntimeError: Error compiling objects for extension

1.下载DCNv2模型

https://github.com/jinfagang/DCNv2_latest

2.下载安装vs2017,测试了2015,2019都不行

Windows10 DCNv2编译_第1张图片

打开命令行工具

3.进入到dcnv2-master目录,models\networks\dcnv2-master

运行python setup.py build develop

报错:

UserWarning: It seems that the VC environment is activated but DISTUTILS_USE_SDK is not set.This may lead to multiple activations of the VC env.Please set `DISTUTILS_USE_SDK=1` and try again.

执行如下命令:

set DISTUTILS_USE_SDK=1

再执行

python setup.py build develop

Windows10 DCNv2编译_第2张图片

 成功

测试了很多方法,都不行,最后安装了vs2017,记得勾选c++,然后在2017命令行中执行成功,vs2019命令行中编译都不行。

你可能感兴趣的:(目标检测,pytorch,cuda,python)