栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

detectron2编译错误: error: identifier “single

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

detectron2编译错误: error: identifier “single

Python:3.10
CUDA:11.3
detectron2:0.6
torch:1.11.0+cu113

git clone detectron2的源码之后执行python setup.py build_ext进行编译,出现以下错误:

D:/Applications/WPy64-31040/python-3.10.4.amd64/lib/site-packages/torch/includec10/macros/Macros.h(142): warning C4067: 预处理器指令后有意外标记 - 应输入换行符
D:DeepLearningdetectron2detectron2layerscsrcnms_rotatednms_rotated_cuda.cu(14): error: name must be a namespace name

D:DeepLearningdetectron2detectron2layerscsrcnms_rotatednms_rotated_cuda.cu(68): error: identifier "single_box_iou_rotated" is undefined
          detected during instantiation of "void nms_rotated_cuda_kernel(int, double, const T *, unsigned long long *) [with T=double]"
(105): here

D:DeepLearningdetectron2detectron2layerscsrcnms_rotatednms_rotated_cuda.cu(68): error: type name is not allowed
          detected during instantiation of "void nms_rotated_cuda_kernel(int, double, const T *, unsigned long long *) [with T=double]"
(105): here

D:DeepLearningdetectron2detectron2layerscsrcnms_rotatednms_rotated_cuda.cu(68): warning: expression has no effect          detected during instantiation of "void nms_rotated_cuda_kernel(int, double, const T *, unsigned long long *) [with T=double]"
(105): here

D:DeepLearningdetectron2detectron2layerscsrcnms_rotatednms_rotated_cuda.cu(58): warning: variable "cur_box" was set but never used
          detected during instantiation of "void nms_rotated_cuda_kernel(int, double, const T *, unsigned long long *) [with T=double]"
(105): here

D:DeepLearningdetectron2detectron2layerscsrcnms_rotatednms_rotated_cuda.cu(68): error: identifier "single_box_iou_rotated" is undefined
          detected during instantiation of "void nms_rotated_cuda_kernel(int, double, const T *, unsigned long long *) [with T=float]"
(105): here

D:DeepLearningdetectron2detectron2layerscsrcnms_rotatednms_rotated_cuda.cu(68): error: type name is not allowed
          detected during instantiation of "void nms_rotated_cuda_kernel(int, double, const T *, unsigned long long *) [with T=float]"
(105): here

D:DeepLearningdetectron2detectron2layerscsrcnms_rotatednms_rotated_cuda.cu(68): warning: expression has no effect          detected during instantiation of "void nms_rotated_cuda_kernel(int, double, const T *, unsigned long long *) [with T=float]"
(105): here

D:DeepLearningdetectron2detectron2layerscsrcnms_rotatednms_rotated_cuda.cu(58): warning: variable "cur_box" was set but never used
          detected during instantiation of "void nms_rotated_cuda_kernel(int, double, const T *, unsigned long long *) [with T=float]"
(105): here

5 errors detected in the compilation of "D:/DeepLearning/detectron2/detectron2/layers/csrc/nms_rotated/nms_rotated_cuda.cu".
error: command 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.3\bin\nvcc.exe' failed with exit code 1
解决办法

根据https://github.com/facebookresearch/detectron2/issues/1601 的方法,修改源码"detectron2layerscsrcnms_rotatednms_rotated_cuda.cu":

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/934557.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号