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

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

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

https://github.com/CoinCheung/pytorch-loss/pull/37icon-default.png?t=M3K6https://github.com/CoinCheung/pytorch-loss/pull/37

手段过于粗暴

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

https://github.com/CoinCheung/pytorch-loss/pull/37/filesicon-default.png?t=M3K6https://github.com/CoinCheung/pytorch-loss/pull/37/files

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

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐