flat\u hash\u map.h:错误C3203:'模板化的迭代器':非专用类temp

2024-04-28 04:49:23 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图构建dcn,但出现以下错误:

 /torch/include\c10/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/include\c10/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/include\c10/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/include\c10/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/include\c10/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/include\c10/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/include\c10/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/include\c10/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/include\c10/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/include\c10/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/include\c10/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/include\c10/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/include\c10/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/include\c10/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/include\c10/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/include\c10/util/flat_hash_map.h(1511): note: see reference to class template instantiation 'ska::flat_hash_set<T,H,E,A>' being compiled
 /torch/include\c10/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/include\c10/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/include\c10/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/include\c10/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 Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin\nvcc.exe -c src/deform_conv_cuda_kernel.cu -o build\temp.win-amd64-3.5\Release\src/deform_conv_cuda_kernel.obj -IC:\Users\127051\AppData\Local\Programs\Python\Python35\lib\site-packages\torch\include -IC:\Users\127051\AppData\Local\Programs\Python\Python35\lib\site-packages\torch\include\torch\csrc\api\include -IC:\Users\127051\AppData\Local\Programs\Python\Python35\lib\site-packages\torch\include\TH -IC:\Users\127051\AppData\Local\Programs\Python\Python35\lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include" -IC:\Users\127051\AppData\Local\Programs\Python\Python35\include -IC:\Users\127051\AppData\Local\Programs\Python\Python35\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" -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

我想原因可能是我的visualstudio版本是VS2015,但我也安装了VS2019,但我不知道如何强制pythonsetuptools使用VS2019,它默认使用VS2015。你知道吗

谢谢。你知道吗


Tags: mapincludeutiltemplateerrorhashtorchtemplated
1条回答
网友
1楼 · 发布于 2024-04-28 04:49:23

因为我认为问题出在我的编译器版本上,我通过以下方法解决了:

首先,我在命令提示符下运行以下命令:

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

然后我成功地建造了它。你知道吗

相关问题 更多 >