参考:
最新的faster r-cnn与cudnn 5.1不兼容,编译caffe-fast-rcnn 时会报代码错误。
In file included from ./include/caffe/util/cudnn.hpp:5:0, from ./include/caffe/util/device_alternate.hpp:40, from ./include/caffe/common.hpp:19, from ./include/caffe/util/db.hpp:6, from src/caffe/util/db.cpp:1: /usr/local/cuda/include/cudnn.h:803:27: note: declared here cudnnStatus_t CUDNNWINAPI cudnnSetPooling2dDescriptor( ^ make: *** [.build_release/src/caffe/util/db.o] Error 1
解决办法:
方法1:利用git修改
cd caffe-fast-rcnn git remote add caffe https://github.com/BVLC/caffe.git git fetch caffe git merge -X theirs caffe/master
然后在合并之后注释掉include/caffe/layers/python_layer.hpp文件里的self_.attr(“phase”) = static_cast(this->phase_)
方法2:纯手工修改
用最新caffe源码的以下文件替换掉faster rcnn 的对应文件include/caffe/layers/cudnn_relu_layer.hpp, src/caffe/layers/cudnn_relu_layer.cpp, src/caffe/layers/cudnn_relu_layer.cuinclude/caffe/layers/cudnn_sigmoid_layer.hpp, src/caffe/layers/cudnn_sigmoid_layer.cpp, src/caffe/layers/cudnn_sigmoid_layer.cu
include/caffe/layers/cudnn_tanh_layer.hpp, src/caffe/layers/cudnn_tanh_layer.cpp, src/caffe/layers/cudnn_tanh_layer.cu
用caffe源码中的这个文件替换掉faster rcnn 对应文件
include/caffe/util/cudnn.hpp将 faster rcnn 中的 src/caffe/layers/cudnn_conv_layer.cu 文件中的所有
cudnnConvolutionBackwardData_v3 函数名替换为 cudnnConvolutionBackwardDatacudnnConvolutionBackwardFilter_v3函数名替换为 cudnnConvolutionBackwardFilter
问题二、
ImportError: No module named _tkinter
cryhelyxx@ada:~/python_workspace$ python httpurl.py Traceback (most recent call last): File "httpurl.py", line 4, inimport Tkinter File "/usr/local/lib/python2.7/lib-tk/Tkinter.py", line 39, in import _tkinter # If this fails your Python may not be configured for Tk ImportError: No module named _tkinter
sudo apt-get install python-tk