当前位置: 首页 > windows10 > 正文

win10配置detectron2报错:\nvcc.exe‘ failed with exit code 1解决办法

我在Windows10+Pytorch1.10.0+CUDA11.1环境下配置detectron2遇到如下问题:

E:/python/PycharmProject/detectron2/detectron2/layers/csrc/nms_rotated/nms_rotated_cuda.cu(15): error: name must be a namespace name

E:/python/PycharmProject/detectron2/detectron2/layers/csrc/nms_rotated/nms_rotated_cuda.cu(69): 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

E:/python/PycharmProject/detectron2/detectron2/layers/csrc/nms_rotated/nms_rotated_cuda.cu(69): 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

E:/python/PycharmProject/detectron2/detectron2/layers/csrc/nms_rotated/nms_rotated_cuda.cu(69): 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

E:/python/PycharmProject/detectron2/detectron2/layers/csrc/nms_rotated/nms_rotated_cuda.cu(59): 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

E:/python/PycharmProject/detectron2-blendmask/detectron2/layers/csrc/nms_rotated/nms_rotated_cuda.cu(69): 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

E:/python/PycharmProject/detectron2-blendmask/detectron2/layers/csrc/nms_rotated/nms_rotated_cuda.cu(69): 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

E:/python/PycharmProject/detectron2/detectron2/layers/csrc/nms_rotated/nms_rotated_cuda.cu(69): 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

E:/python/PycharmProject/detectron2/detectron2/layers/csrc/nms_rotated/nms_rotated_cuda.cu(59): 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 "E:/python/PycharmProject/detectron2/detectron2/layers/csrc/nms_rotated/nms_rotated_cuda.cu".
error: command 'C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v11.1\\bin\\nvcc.exe' failed with exit code 1


解决办法:

打开E:/python/PycharmProject/detectron2/detectron2/layers/csrc/nms_rotated/nms_rotated_cuda.cu文件,修改下列内容:

在这里插入图片描述

修改成:

在这里插入图片描述

重新运行即可。

本文固定链接: https://www.ziyouwu.com/archives/29808.html | 自由屋博客


关键字: ,