Pytorch Error: error: identifier “AT_CHECK“ is undefined [How to Solve]

These two days, run a mask RCNN series of network code, and execute the command Python 3 setup A bunch of such errors are received during py build development, as follows:

.../detectron2/layers/csrc/deformable/deform_conv.h(136): error: identifier "AT_CHECK" is undefined

.../detectron2/layers/csrc/deformable/deform_conv.h(184): error: identifier "AT_CHECK" is undefined

.../detectron2/layers/csrc/deformable/deform_conv.h(234): error: identifier "AT_CHECK" is undefined

.../detectron2/layers/csrc/deformable/deform_conv.h(284): error: identifier "AT_CHECK" is undefined

.../detectron2/layers/csrc/deformable/deform_conv.h(341): error: identifier "AT_CHECK" is undefined

.../detectron2/layers/csrc/deformable/deform_conv_cuda.cu(155): error: identifier "AT_CHECK " is undefined

.../detectron2/layers/csrc/deformable/deform_conv_cuda.cu(338): error: identifier "AT_CHECK " is undefined

.../detectron2/layers/csrc/deformable/deform_conv_cuda.cu(503): error: identifier "AT_CHECK " is undefined

.../detectron2/layers/csrc/deformable/deform_conv_cuda.cu(696): error: identifier "AT_CHECK " is undefined

.../detectron2/layers/csrc/deformable/deform_conv_cuda.cu(823): error: identifier "AT_CHECK " is undefined

.../detectron2/layers/csrc/deformable/deform_conv_cuda.cu(953): error: identifier "AT_CHECK " is undefined

11 errors detected in the compilation of ".../detectron2/layers/csrc/deformable/deform_conv _cuda.cu".

Solution:

Replace all AT_CHECK in deform_conv_cuda.cpp with TORCH_CHECK

or macro definition:

#ifndef AT_CHECK
#define AT_CHECK TORCH_CHECK 
#endif

Read More: