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即可。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM