本机配置:系统 Ubuntu 18.04,CUDA 11.2
环境 Python 3.8, Torch 1.9.0
按照官网安装命令运行:
cd pointnet2
python setup.py install
报错1:
error:'THCState_getcurrentstream'was not declared in this scope
失败:采用报错提示将THCState_getcurrentstream(state)更换为THCState_getCudaHostAllocator(state)
成功:将THCState_getcurrentstream(state)更换为at::cuda::getCurrentCUDAStream().stream()。(参考THCState_getCurrentStream in torch1.5 - PyTorch Forums)将其他cpp文件中的THCState_getcurrentstream(state)一并改好即可。
报错2:
error: 'AT_CHECK' was not declaredin this scope
成功:将所有AT_CHECK改为TORCH_CHECK(参考Pointnet2_pytorch代码复现-CSDN博客)
再次运行,编译成功