CharlesShang/DCNv2

Windows Build/Link Error

PNeigel opened this issue · 3 comments

I'm on Windows and I'm getting the following error:

C:\Files\Repos\DCNv2_old>python setup.py build develop
running build
running build_ext
building '_ext' extension
creating C:\Files\Repos\DCNv2_old\build\temp.win-amd64-3.7\Release\Files\Repos\DCNv2_old
creating C:\Files\Repos\DCNv2_old\build\temp.win-amd64-3.7\Release\Files\Repos\DCNv2_old\src
creating C:\Files\Repos\DCNv2_old\build\temp.win-amd64-3.7\Release\Files\Repos\DCNv2_old\src\cpu
creating C:\Files\Repos\DCNv2_old\build\temp.win-amd64-3.7\Release\Files\Repos\DCNv2_old\src\cuda
Emitting ninja build file C:\Files\Repos\DCNv2_old\build\temp.win-amd64-3.7\Release\build.ninja...
Compiling objects...
Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)
1.10.0
creating C:\Files\Repos\DCNv2_old\build\lib.win-amd64-3.7
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:C:\Anaconda3\envs\torch16\lib\site-packages\torch\lib "/LIBPATH:C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\lib/x64" /LIBPATH:C:\Anaconda3\envs\torch16\libs /LIBPATH:C:\Anaconda3\envs\torch16\PCbuild\amd64 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\ATLMFC\lib\x86" "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\lib\x86" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.17763.0\ucrt\x86" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.17763.0\um\x86" c10.lib torch.lib torch_cpu.lib torch_python.lib cudart.lib c10_cuda.lib torch_cuda.lib /EXPORT:PyInit__ext C:\Files\Repos\DCNv2_old\build\temp.win-amd64-3.7\Release\Files\Repos\DCNv2_old\src\vision.obj C:\Files\Repos\DCNv2_old\build\temp.win-amd64-3.7\Release\Files\Repos\DCNv2_old\src\cpu\dcn_v2_cpu.obj C:\Files\Repos\DCNv2_old\build\temp.win-amd64-3.7\Release\Files\Repos\DCNv2_old\src\cpu\dcn_v2_im2col_cpu.obj C:\Files\Repos\DCNv2_old\build\temp.win-amd64-3.7\Release\Files\Repos\DCNv2_old\src\cpu\dcn_v2_psroi_pooling_cpu.obj C:\Files\Repos\DCNv2_old\build\temp.win-amd64-3.7\Release\Files\Repos\DCNv2_old\src\cuda\dcn_v2_cuda.obj C:\Files\Repos\DCNv2_old\build\temp.win-amd64-3.7\Release\Files\Repos\DCNv2_old\src\cuda\dcn_v2_im2col_cuda.obj C:\Files\Repos\DCNv2_old\build\temp.win-amd64-3.7\Release\Files\Repos\DCNv2_old\src\cuda\dcn_v2_psroi_pooling_cuda.obj /OUT:build\lib.win-amd64-3.7_ext.cp37-win_amd64.pyd /IMPLIB:C:\Files\Repos\DCNv2_old\build\temp.win-amd64-3.7\Release\Files\Repos\DCNv2_old\src_ext.cp37-win_amd64.lib
LINK : fatal error LNK1181: cannot open input file 'C:\Files\Repos\DCNv2_old\build\temp.win-amd64-3.7\Release\Files\Repos\DCNv2_old\src\vision.obj'
error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86\link.exe' failed with exit status 1181

Interesting is the bold fatal error, it's trying to open a compiled .obj, but every directory in \build\temp.win-amd64-3.7\Release\Files\ is empty, so apparently it's trying to link before compiling anything.

I'm on pytorch 1.6, CUDA 10.2, cudatoolkit 10.2.89, torchvision 0.7 and Windows 10

exactly the same issue on my Win10 computer, did you manage it QwQ?

Update 2021/2/16: Solved by changing torch version to 1.2.0

Hi, I get the same issue with torch==1.7.1, cuda==11.0 on windows, have you managed it or any suggestions? Thanks!

For all latest pytorchs with cuda on Windows:
https://github.com/rathaROG/DCNv2_Windows