这两天运行一个mask-rcnn系列网络的代码,在执行命令 python3 setup.py build develop 时收到一堆这样错误如下:
.../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".
百度一大堆之后找到了解决方法:把涉及错误的文件里面所有的AT_CHECK替换为TORCH_CHECK,大功告成!
参考博客:https://blog.youkuaiyun.com/weixin_44444492/article/details/118887280
这篇博客分享了在使用Detectron2进行mask-rcnn项目时遇到的编译错误,通过将代码中的AT_CHECK替换为TORCH_CHECK解决了问题。博主详细解释了错误原因并提供了解决方案,适用于对Detectron2库有需求的开发者。
2072

被折叠的 条评论
为什么被折叠?



