错误原因
在使用pytorch
编译maskrcnn-benchmark的时候报,如下错误
idia/.local/lib/python3.6/site-packages/torch/include/THC -I/usr/local/cuda/include -I/usr/include/python3.6m -c /home/nvidia/maskrcnn-benchmark/maskrcnn_benchmark/csrc/cuda/deform_pool_cuda.cu -o build/temp.linux-aarch64-3.6/home/nvidia/maskrcnn-benchmark/maskrcnn_benchmark/csrc/cuda/deform_pool_cuda.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ‘-fPIC’ -DCUDA_HAS_FP16=1 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=1 -gencode=arch=compute_72,code=sm_72 -std=c++14
/home/nvidia/maskrcnn-benchmark/maskrcnn_benchmark/csrc/cuda/deform_pool_cuda.cu(42): error: identifier “AT_CHECK” is undefined
/home/nvidia/maskrcnn-benchmark/maskrcnn_benchmark/csrc/cuda/deform_pool_cuda.cu(68): error: identifier “AT_CHECK” is undefined
2 errors detected in the compilation of “/tmp/tmpxft_00003557_00000000-6_deform_pool_cuda.cpp1.ii”.
error: command ‘/usr/local/cuda/bin/nvcc’ failed with exit status 1
环境配置
- python:3.8.5
- pytorch:1.7
解决办法
将报错行中的AT_CHECK
替换为TORCH_CHECK
即可
参考:https://github.com/facebookresearch/maskrcnn-benchmark/issues/1248