fatal error: THC/THC.h: No such file or directory

笔者在配置训练环境,编译cu文件时出现了这个错误

fatal error: THC/THC.h: No such file or directory

查询解决方案后其他答主给出的解决办法是pytorch降级并贴出了官方pr

https://github.com/CoinCheung/pytorch-loss/pull/37https://github.com/CoinCheung/pytorch-loss/pull/37

手段过于粗暴

仔细查看pr提交可发现删除THC/THC.h是因为用新函数实现了功能

https://github.com/CoinCheung/pytorch-loss/pull/37/fileshttps://github.com/CoinCheung/pytorch-loss/pull/37/files

修改自己的cu文件替换旧的函数,编译通过

来源:o0stinger0o

物联沃分享整理
物联沃-IOTWORD物联网 » fatal error: THC/THC.h: No such file or directory

发表评论