python setup.py build --force develop
出现报错:
ir.h(1347): error: member "torch::jit::ProfileOptionalOp::Kind" may not be initialized
查阅了许多博客的解决办法就是定位到指定位置,注释掉这一句话
但是,接下来编译又出现了好多问题:
nms_rotated_cuda.cu
D:/ProgramData/Anaconda3/envs/det/lib/site-packages/torch/include\c10/util/ThreadLocalDebugInfo.h(12): warning: modifier is ignored on an enum specifier
E:/Code/open-world-ob-gym/OWOD/detectron2/layers/csrc/nms_rotated/nms_rotated_cuda.cu(14): error: name must be a namespace name
E:/Code/open-world-ob-gym/OWOD/detectron2/layers/csrc/nms_rotated/nms_rotated_cuda.cu(68): error: identifier "single_box_iou_rotated" is undefined
detected during instantiation of "void nms_rotated_cuda_kernel(int, float, const T *, unsigned long long *) [with T=double]"
(105): here
E:/Code/open-world-ob-gym/OWOD/detectron2/layers/csrc/nms_rotated/nms_rotated_cuda.cu(68): error: type name is not allowed
detected during instantiation of "void nms_rotated_cuda_kernel(int, float, const T *, unsigned long long *) [with T=double]"
(105): here
E:/Code/open-world-ob-gym/OWOD/detectron2/layers/csrc/nms_rotated/nms_rotated_cuda.cu(68): warning: expression has no effect
detected during instantiation of "void nms_rotated_cuda_kernel(int, float, const T *, unsigned long long *) [with T=double]"
(105): here
E:/Code/open-world-ob-gym/OWOD/detectron2/layers/csrc/nms_rotated/nms_rotated_cuda.cu(58): warning: variable "cur_box" was set but never used
detected during instantiation of "void nms_rotated_cuda_kernel(int, float, const T *, unsigned long long *) [with T=double]"
(105): here
E:/Code/open-world-ob-gym/OWOD/detectron2/layers/csrc/nms_rotated/nms_rotated_cuda.cu(68): error: identifier "single_box_iou_rotated" is undefined
detected during instantiation of "void nms_rotated_cuda_kernel(int, float, const T *, unsigned long long *) [with T=float]"
(105): here
E:/Code/open-world-ob-gym/OWOD/detectron2/layers/csrc/nms_rotated/nms_rotated_cuda.cu(68): error: type name is not allowed
detected during instantiation of "void nms_rotated_cuda_kernel(int, float, const T *, unsigned long long *) [with T=float]"
(105): here
E:/Code/open-world-ob-gym/OWOD/detectron2/layers/csrc/nms_rotated/nms_rotated_cuda.cu(68): warning: expression has no effect
detected during instantiation of "void nms_rotated_cuda_kernel(int, float, const T *, unsigned long long *) [with T=float]"
(105): here
E:/Code/open-world-ob-gym/OWOD/detectron2/layers/csrc/nms_rotated/nms_rotated_cuda.cu(58): warning: variable "cur_box" was set but never used
detected during instantiation of "void nms_rotated_cuda_kernel(int, float, const T *, unsigned long long *) [with T=float]"
(105): here
5 errors detected in the compilation of "C:/Users/miclo/AppData/Local/Temp/tmpxft_00000c50_00000000-7_nms_rotated_cuda.cpp1.ii".
error: command 'C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v10.1\\bin\\nvcc.exe' failed with exit status 1
关键词是:nms_rotated_cuda.cu(68),所以问题出在这里,需要如下操作:
之后,问题完美解决。
PS:这里我之前做过一件事情是将vs2019的cl.exe添加到了环境变量中。如果上边有问题可以参考这一条。