error: identifier “AT_CHECK” is undefined
解決方法: 找到出現這個問題的第一行,我這裡是:/home/xx/桌面/detectron2/detectron2/detectron2/layers/csrc/deformable/deform_conv.h(135): error: identifier "AT_CHECK" is undefined
。就是頭文件中缺少定義,我們使用編輯器去修改頭文件即可:
nano /home/xx/桌面/detectron2/detectron2/detectron2/layers/csrc/deformable/deform_conv.h
- 加入定義:
#define AT_CHECK TORCH_CHECK
如下圖:

- ctrl + s保存; ctrl + x退出。然後重新安裝,這個錯誤就消失了。