我试图构建dcn,但我得到了这些错误:
/torch/includec10/util/order_preserving_flat_hash_map.h(1499): error C3203: 'templated_iterator': unspecialized class template can't be used as a template argument for template parameter '_Ty1', expected a real type
/torch/includec10/util/order_preserving_flat_hash_map.h(1557): note: see reference to class template instantiation 'ska_ordered::order_preserving_flat_hash_map<K,V,H,E,A>' being compiled
/torch/includec10/util/order_preserving_flat_hash_map.h(1503): error C3203: 'templated_iterator': unspecialized class template can't be used as a template argument for template parameter '_Ty1', expected a real type
/torch/includec10/util/order_preserving_flat_hash_map.h(1511): error C3203: 'templated_iterator': unspecialized class template can't be used as a template argument for template parameter '_Ty1', expected a real type
/torch/includec10/util/order_preserving_flat_hash_map.h(1593): error C3203: 'templated_iterator': unspecialized class template can't be used as a template argument for template parameter '_Ty1', expected a real type
/torch/includec10/util/order_preserving_flat_hash_map.h(1630): note: see reference to class template instantiation 'ska_ordered::flat_hash_set<T,H,E,A>' being compiled
/torch/includec10/util/order_preserving_flat_hash_map.h(1598): error C3203: 'templated_iterator': unspecialized class template can't be used as a template argument for template parameter '_Ty1', expected a real type
/torch/includec10/util/order_preserving_flat_hash_map.h(1602): error C3203: 'templated_iterator': unspecialized class template can't be used as a template argument for template parameter '_Ty1', expected a real type
/torch/includec10/util/order_preserving_flat_hash_map.h(1606): error C3203: 'templated_iterator': unspecialized class template can't be used as a template argument for template parameter '_Ty1', expected a real type
/torch/includec10/util/order_preserving_flat_hash_map.h(1610): error C3203: 'templated_iterator': unspecialized class template can't be used as a template argument for template parameter '_Ty1', expected a real type
/torch/includec10/util/flat_hash_map.h(1380): error C3203: 'templated_iterator': unspecialized class template can't be used as a template argument for template parameter '_Ty1', expected a real type
/torch/includec10/util/flat_hash_map.h(1438): note: see reference to class template instantiation 'ska::flat_hash_map<K,V,H,E,A>' being compiled
/torch/includec10/util/flat_hash_map.h(1384): error C3203: 'templated_iterator': unspecialized class template can't be used as a template argument for template parameter '_Ty1', expected a real type
/torch/includec10/util/flat_hash_map.h(1392): error C3203: 'templated_iterator': unspecialized class template can't be used as a template argument for template parameter '_Ty1', expected a real type
/torch/includec10/util/flat_hash_map.h(1474): error C3203: 'templated_iterator': unspecialized class template can't be used as a template argument for template parameter '_Ty1', expected a real type
/torch/includec10/util/flat_hash_map.h(1511): note: see reference to class template instantiation 'ska::flat_hash_set<T,H,E,A>' being compiled
/torch/includec10/util/flat_hash_map.h(1479): error C3203: 'templated_iterator': unspecialized class template can't be used as a template argument for template parameter '_Ty1', expected a real type
/torch/includec10/util/flat_hash_map.h(1483): error C3203: 'templated_iterator': unspecialized class template can't be used as a template argument for template parameter '_Ty1', expected a real type
/torch/includec10/util/flat_hash_map.h(1487): error C3203: 'templated_iterator': unspecialized class template can't be used as a template argument for template parameter '_Ty1', expected a real type
/torch/includec10/util/flat_hash_map.h(1491): error C3203: 'templated_iterator': unspecialized class template can't be used as a template argument for template parameter '_Ty1', expected a real type
这是setup.py
运行它的命令脚本:
C:Program FilesNVIDIA GPU Computing ToolkitCUDAv10.1binnvcc.exe -c src/deform_conv_cuda_kernel.cu -o buildtemp.win-amd64-3.5Releasesrc/deform_conv_cuda_kernel.obj -IC:Users127051AppDataLocalProgramsPythonPython35libsite-packagestorchinclude -IC:Users127051AppDataLocalProgramsPythonPython35libsite-packagestorchincludetorchcsrcapiinclude -IC:Users127051AppDataLocalProgramsPythonPython35libsite-packagestorchincludeTH -IC:Users127051AppDataLocalProgramsPythonPython35libsite-packagestorchincludeTHC "-IC:Program FilesNVIDIA GPU Computing ToolkitCUDAv10.1include" -IC:Users127051AppDataLocalProgramsPythonPython35include -IC:Users127051AppDataLocalProgramsPythonPython35include "-IC:Program Files (x86)Microsoft Visual Studio 14.0VCINCLUDE" "-IC:Program Files (x86)Microsoft Visual Studio 14.0VCATLMFCINCLUDE" "-IC:Program Files (x86)Windows Kits10include10.0.18362.0ucrt" "-IC:Program Files (x86)Windows KitsNETFXSDK4.6.1includeum" "-IC:Program Files (x86)Windows Kits10include10.0.18362.0shared" "-IC:Program Files (x86)Windows Kits10include10.0.18362.0um" "-IC:Program Files (x86)Windows Kits10include10.0.18362.0winrt" -Xcompiler /EHsc -Xcompiler /wd4819 -Xcompiler /MD -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=deform_conv_cuda -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_50,code=sm_50
deform_conv_cuda_kernel.cu
我认为原因可能是我的Visual Studio版本是VS 2015,但我也安装了VS 2019,但我不知道如何强制pythonsetuptools
使用VS2019,它默认使用VS2015。
谢谢。
因为我认为问题出在我的编译器版本上,我通过以下方式解决了:
首先我在命令提示符下运行以下命令:
SET MSSdk=1
SET DISTUTILS_USE_SDK=1
call "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvarsall.bat" amd64 8.1 -vcvars_ver=14.23
然后我成功地构建了它。