概要:编译ops里面代码的时候,出现了RuntimeError: Error compiling objects for extension 这样的错误提示
问题分析:在网上查看了很多资料,感觉都不适合我的情况。后来查看作者的INSTALL.md文档,发现 pytorch版本限定在了1.1和1.3.1,而我的pytorch版本为1.71!而且作者指出了:
Note:
- If you want to use Pytorch>1.5, you have to made some modifications to the
cuda ops
. See here for a reference.- There is a known bug happened to some users but not all (As I have successfully run it on V100 and Titan Xp). If it occurs, please refer to here.
- If you want to use Python<=3.6, you need to install e2cnn@legacy_py3.6 mamually, see here for an instruction.
即:如果是1.5以上版本,需要修改 cuda ops
.具体为:
AT_CHECK
withTORCH_CHECK
in the source code (.cpp
and.cu
).
把所有cpp和cu里的AT_CHECK替换为TORCH_CHECK
查看INSTALL.md文档很重要!
查看INSTALL.md文档很重要!
查看INSTALL.md文档很重要!
重要的事情说三遍!