繁体   English   中英

flat_hash_map.h:错误 C3203:'templated_iterator':非专业化的类模板

[英]flat_hash_map.h : error C3203: 'templated_iterator': unspecialized class template

我尝试构建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

我认为原因可能是因为我的 Visual Studio 版本是 VS 2015,但我也安装了 VS 2019 但我不知道如何强制 python setuptools使用 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

然后我成功构建了它。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM