原因
安装的pytorch 版本大于1.5 ,在1.5以上版本中删除了THCState_getCurrentStream
解决方法
将 THCState_getCurrentStream(state) 替换为at::cuda::getCurrentCUDAStream().stream()
原始的
createBatchGemmBuffer<<<grid, block, 0, THCState_getCurrentStream(state)>>>(
... ...
modulated_deformable_im2col_cuda(THCState_getCurrentStream(state),
... ...
更改为
createBatchGemmBuffer<<<grid, block, 0, at::cuda::getCurrentCUDAStream().stream()>>>(
... ...
modulated_deformable_im2col_cuda(at::cuda::getCurrentCUDAStream().stream(),
... ...
问题便可解决
或者可以直接将pytorch版本降低至1.2
参考链接:https://discuss.pytorch.org/t/thcstate-getcurrentstream-in-torch1-5/85754