目录
- 源码编译pytorch坑
- git clone拉取问题
- 编译报错:../caffe2/contrib/aten/aten_op.h:1:52: fatal error: caffe2/caffe2/contrib/aten/gen_aten_op.h: No such file or directory #include "caffe2/caffe2/contrib/aten/gen_aten_op.h"
- Aborted (core dumped)
- 编译成功后运行报错:RuntimeError: module compiled against API version 0xe but this version of numpy is 0xd
源码编译pytorch坑
nimble是一个对pytorch进行修改的神经网络加速包,本篇文章记录下配置nimble环境遇到的一些问题,可供以后回忆参考。
git clone拉取问题
国内访问github很慢,而且由于需要递归拉去子模块:
git clone --recursive https://github.com/snuspl/nimble
经常fatal或者拉去失败,目前觉得原因是由于网络问题,解决方法就是不停的在项目目录中执行如下命令:
git submodule update --init --recursive
然后等执行编译脚本的时候根据报错提示前往第三方库中拉取对应的仓库到文件夹中
编译报错:…/caffe2/contrib/aten/aten_op.h:1:52: fatal error: caffe2/caffe2/contrib/aten/gen_aten_op.h: No such file or directory #include “caffe2/caffe2/contrib/aten/gen_aten_op.h”
在pytorch的github的issue页面搜索得知,需要在编译时添加USE_NINJA=OFF选项,并且如果之前已经编过一遍,最好将build目录删掉重新编译
Aborted (core dumped)
torchvision等库最好也从源码安装,才不会报错,此时我进行了从头编译与安装才没问题
编译成功后运行报错:RuntimeError: module compiled against API version 0xe but this version of numpy is 0xd
进入终端,查看numpy版本号
pip show numpy
更新numpy
pip install -U numpy
解决