之前介绍了原版SuperPoint,可惜原版没有公开训练代码,接下来看一个复现版本。
为了成功运行这个版本,反复配置无数遍,建议大家就跟着我的方法来,一次就成功。
运行成功,cuda cudnn tensorflow-gpu 版本和之间的版本对应十分重要,配置有点不对,后面各种问题。
1.配置虚拟安装环境
首先安装anaconda,用来配置虚拟环境,我用的3.5.3版本,我是系统是ubuntu18.04。
下载后终端命令安装(一路回车,yes,问到vscode,填no,安装完成。)
bash Anaconda3-5.3.0-Linux-x86_64.sh
安装完成后创造一个python=3.6的环境(3.7遇到tf1.12无法安装的错)
conda create --name superpoint python=3.6
2.开始superpoint环境配置
别用pip配TensorFlow 然后conda配cuda cudnn 那样版本都需要自己控制,非常容易出问题。用conda配TensorFlow,conda会适配cuda cudnn。
conda install tensorflow-gpu=1.12
安装完毕用 查看一下配置
conda list
可以看见cuda cudnn都安装好了 分别是10.0 和 7.6.5
由于已经安装了TensorFlow-gpu 则在编译源码前需要在requirement.txt中去掉TensorFlow-gpu
打开SuperPoint/requirement.txt 去掉第一行的TensorFlow==1.12
然后开始安装源码,在Superpont目录下。
make install
3.配置完毕 盘点我遇到的小部分报错
Check failed: h != kInvalidChunkHandle TensorFlow版本问题 1.12改1.13。
load without loader yaml.load掉了参数 改为config = yaml.load(f,Loader=yaml.FullLoader)
大概是input axle 0 200,shape must(50,150,0) 调用两个以上gpu训练就会遇到,建议就两个来。
scores has incompatible shape tf cuda cudnn 之间的版本错误
Check failed: cusolverDnCreate(&cusolver_dn_handle) == CUSOLVER_STATUS_SUCCESS Failed to create cuSolverDN instance 终端运行export TF_FORCE_GPU_ALLOW_GROWTH=true
OP_REQUIRES failed at cholesky_op.cc:154 : Internal: tensorflow/core/kernels/cuda_solvers.cc:375: cuSolverDN call failed with status =7 tf cuda cudnn 之间的版本错误