一.Caffe installation
如果熟悉上述1,2,3的同学,那么最新版本的Caffe安装基本不会出现什么问题,如有问题请见上述推荐文章。
上述文章可能未覆盖到的问题
error while loading shared libraries: libcudnn.so.5: cannot open shared object file: No such file or directory
原因:自己安装的caffe库文件所在路径未添加到/etc/ld.so.conf文件中
解决方法
进入自己安装的caffe库文件所在位置,并把路径添加到/etc/ld.so.conf文件中
tju@tju-System-Product-Name:~$ cd tju/caffe/build/lib/
tju@tju-System-Product-Name:~/tju/caffe/build/lib$ pwd
/home/tju/tju/caffe/build/lib
cd 要存放文件的位置
git clone --recursive https://github.com/rbgirshick/py-faster-rcnn.git
cd py-faster-rcnn/lib/
make
删除caffe-faster-rcnn中所有文件
拷贝未经编译过的最新版caffe中所有文件到caffe-faster-rcnn中
cd ../caffe-fast-rcnn/
cd python/
for req in $(cat requirements.txt); do sudo pip install $req; done
cd ..
cp Makefile.config.example Makefile.config
make all -j16
make test -j16
make runtest -j16
跑通
make pycaffe
跑通
1.ImportError: No module named scipy
解决:sudo pip install scipy
2.error: library dfftpack has Fortran sources but no Fortran compiler found
解决:sudo apt-get install gfortran
http://blog.csdn.net/u010551621/article/details/46363853
3.Error parsing text-format caffe.NetParameter: 350:21: Message type "caffe.LayerParameter" has no field named "roi_pooling_param"
ReadProtoFromTextFile(param_file, param) Failed to parse NetParameter file: /home/tju/tju/py-faster-rcnn/models/pascal_voc/VGG16/faster_rcnn_alt_opt/faster_rcnn_test.pt
详细报错内容
/usr/local/lib/python2.7/dist-packages/matplotlib/font_manager.py:273: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment.
warnings.warn('Matplotlib is building the font cache using fc-list. This may take a moment.')
WARNING: Logging before InitGoogleLogging() is written to STDERR
W1124 23:36:53.414587 9519 _caffe.cpp:122] DEPRECATION WARNING - deprecated use of Python interface
W1124 23:36:53.414649 9519 _caffe.cpp:123] Use this instead (with the named "weights" parameter):
W1124 23:36:53.414660 9519 _caffe.cpp:125] Net('/home/tju/tju/py-faster-rcnn/models/pascal_voc/VGG16/faster_rcnn_alt_opt/faster_rcnn_test.pt', 1, weights='/home/tju/tju/py-faster-rcnn/data/faster_rcnn_models/VGG16_faster_rcnn_final.caffemodel')
[libprotobuf ERROR google/protobuf/text_format.cc:245] Error parsing text-format caffe.NetParameter: 350:21: Message type "caffe.LayerParameter" has no field named "roi_pooling_param".
F1124 23:36:53.437803 9519 upgrade_proto.cpp:88] Check failed: ReadProtoFromTextFile(param_file, param) Failed to parse NetParameter file: /home/tju/tju/py-faster-rcnn/models/pascal_voc/VGG16/faster_rcnn_alt_opt/faster_rcnn_test.pt
*** Check failure stack trace: ***
解决:这个问题基本已经百度不到了,换google,中文没找到解决方案,英文中有一个相关问题解答,但是没说如何解决
问题原因:caffe版本不对
基本思路:need to update your build of Caffe and Run upgrade_net.cpp
In file included from /home/tju/tju/py-faster-rcnn/caffe-fast-rcnn/include/caffe/common.hpp:19:0,
from /home/tju/tju/py-faster-rcnn/caffe-fast-rcnn/include/caffe/blob.hpp:8,
from /home/tju/tju/py-faster-rcnn/caffe-fast-rcnn/include/caffe/caffe.hpp:7,
from upgrade_net_proto_text.cpp:10:
/home/tju/tju/py-faster-rcnn/caffe-fast-rcnn/include/caffe/util/device_alternate.hpp:34:23: fatal error: cublas_v2.h: 没有那个文件或目录
#include <cublas_v2.h>
^
compilation terminated.
tju@tju-System-Product-Name:~/tju/py-faster-rcnn/caffe-fast-rcnn/tools$
tju@tju-System-Product-Name:~$ cd /usr/local/cuda-7.5/targets/x86_64-linux/include/
tju@tju-System-Product-Name:/usr/local/cuda-7.5/targets/x86_64-linux/include$ ls | grep cublas.h
cublas.h
tju@tju-System-Product-Name:/usr/local/cuda-7.5/targets/x86_64-linux/include$ pwd
/usr/local/cuda-7.5/targets/x86_64-linux/include
In file included from /home/tju/tju/py-faster-rcnn/caffe-fast-rcnn/include/caffe/caffe.hpp:7:0,
from upgrade_net_proto_text.cpp:10:
/home/tju/tju/py-faster-rcnn/caffe-fast-rcnn/include/caffe/blob.hpp:9:34: fatal error: caffe/proto/caffe.pb.h: 没有那个文件或目录
#include "caffe/proto/caffe.pb.h"
^
compilation terminated.
root@tju-System-Product-Name:/home/tju/桌面# cd py-faster-rcnn/
root@tju-System-Product-Name:/home/tju/桌面/py-faster-rcnn# cd lib/
root@tju-System-Product-Name:/home/tju/桌面/py-faster-rcnn/lib# make
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe6 in position 10: ordinal not in range(128)
building 'utils.cython_bbox' extension
utils/bbox.c:1:2: error: #error Do not use this file, it is the result of a failed Cython compilation.
#error Do not use this file, it is the result of a failed Cython compilation.
^
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
make: *** [all] 错误 1
原因:路径中有中文,换个地方放
src/caffe/layers/cudnn_tanh_layer.cpp:16:45: error: ‘activ_desc_’ was not declared in this scope
cudnn::createActivationDescriptor<Dtype>(&activ_desc_, CUDNN_ACTIVATION_TANH);
caffe旧官方版本对cudnn只支持到特定的版本,不支持最新的V5版本,v5中需要手动修改