Mask RCNN复现过程过于痛苦,记录每一个深坑。
1.apex安装失败
Cuda版本10.0
Pytorch1.0.0
按照官方INSTALL.MD输入
python setup.py install --cuda_ext --cpp_ext
报错:
In file included from csrc/multi_tensor_sgd_kernel.cu:5:0:
csrc/multi_tensor_apply.cuh:5:10: fatal error: c10/cuda/CUDAGuard.h: No such file or rectory
#include <c10/cuda/CUDAGuard.h>
^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
error: command '/usr/local/cuda/bin/nvcc' failed with exit status 1
查询了n个网站,最后通过科学上网找到解决方法:
在终端输入
git checkout f3a960f80244cf9e80558ab30f7f7e8cbf03c0a0
返回:
Note: checking out 'f3a960f80244cf9e80558ab30f7f7e8cbf03c0a0'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b <new-branch-name>
HEAD is now at f3a960f fix typo
再次输入原安装代码:
python setup.py install --cuda_ext --cpp_ext
成功后:
Processing dependencies for apex==0.1
Finished processing dependencies for apex==0.1
终于解决了一天的问题,但是原理不太清楚,欢迎大佬指点。