Caffe编译过程常见问题

1. caffe.pb.h & caffe.pb.cc (Windows)

如果出现caffe.pb.h和caffe.pb.cc消失,或:

由于修改了datam数据格式造成前后版本caffe.pb.cc文件差异而无法顺利编译的问题,需要重新生成caffe.pb.h和caffe.pb.cc

由于\src\caffe\proto目录下只有“caffe.proto”文件,没有caffe.pb.h 文件。

可以在编译开始前执行预处理的批处理文件extract_proto.bat,这个批处理文件内容如下:

protoc caffe.proto --cpp_out=./
protoc caffe.proto --python_out=./
md ..\..\..\python\caffe\proto\
copy /y .\caffe_pb2.py ..\..\..\python\caffe\proto\
copy nul ..\..\..\python\caffe\proto\__init__.py
pause

执行bat文件后会产生caffe.pb.h和caffe.pb.cc

 

2.OpenBLAS (LINUX)

使用yum install openblas-dev后,直接make all 会出现找不到cblas.h,需要再安装其它几个库:

lapack、lapack-devel、atlas、atlas-devel

具体命令是yum install blas blas-devel lapack lapack-devel atlas atlas-devel  –nogpgcheck

另外,安装完后需要在Makefile.config中配置BLAS库:

BLAS := open

BLAS_INCLUDE := /usr/include

BLAS_LIB := /usr/lib64

3. (LINUX)

I0704 07:55:39.182813 17281 caffe.cpp:144] Finetuning from /PC_root/vgg.caffemodel
[libprotobuf WARNING google/protobuf/io/coded_stream.cc:505] Reading dangerously large protocol message.  If the message turns out to be larger than 2147483647 bytes, parsing will be halted for security reasons.  To increase the limit (or to disable these warnings), see CodedInputStream::SetTotalBytesLimit() in google/protobuf/io/coded_stream.h.
[libprotobuf WARNING google/protobuf/io/coded_stream.cc:78] The total number of bytes read was 580013788
I0704 07:55:40.318063 17281 upgrade_proto.cpp:65] Attempting to upgrade input file specified using deprecated input fields:/PC_root/vgg.caffemodel

该问题是由于caffe/src/caffe/util/upgrade_proto.cpp版本过老引起的,解决方法是将新版本caffe的caffe/src/caffe/util/upgrade_proto.cpp拷贝至旧版本caffe的相应目录下替换该文件,然后重新编译caffe即可。

 

posted @ 2015-11-15 11:14  venus024  阅读(9168)  评论(0编辑  收藏  举报