chongkuiqi/S2ANet

运行2(3)Compilate the C++Cuda Library时报错

Opened this issue · 1 comments

Mei118 commented

models/orn/src/cuda/ActiveRotatingFilter_cuda.cu:5:10: fatal error: THC/THC.h: 没有那个文件或目录
5 | #include <THC/THC.h>
| ^~~~~~~~~~~
compilation terminated.
error: command '/usr/local/cuda/bin/nvcc' failed with exit code 1
我的配置是RTX3060,torch1.12.1+cu116

models/orn/src/cuda/ActiveRotatingFilter_cuda.cu:5:10: fatal error: THC/THC.h: 没有那个文件或目录 5 | #include <THC/THC.h> | ^~~~~~~~~~~ compilation terminated. error: command '/usr/local/cuda/bin/nvcc' failed with exit code 1 我的配置是RTX3060,torch1.12.1+cu116

pytorch1.11之后已经去掉了THC/THC.h,因此有以下两种方法:
(1)安装1.10及以前的pytorch版本;
(2)更改主动旋转滤波器的cuda源码,将#include <THC/THC.h>注释掉,把THCudaCheck替换为AT_CUDA_CHECK,并替换THCCeilDiv(x,y)为(x+y-1)/y,更详细的可以参考这三个帖子,https://blog.csdn.net/qq_51346719/article/details/131160650, https://blog.csdn.net/code_zhao/article/details/129172817,https://github.com/CoinCheung/pytorch-loss/pull/37