前言:
由于業(yè)務(wù)需要,接觸caffe已經(jīng)有接近半年,一直忙著閱讀各種論文,重現(xiàn)大大小小的模型. 期間也總結(jié)過一些caffe源碼學(xué)習(xí)筆記,斷斷續(xù)續(xù),這次打算系統(tǒng)的記錄一下caffe源碼學(xué)習(xí)筆記,鞏固一下C++,同時也梳理一下自己之前的理解。
正文:
我們先不看caffe的框架結(jié)構(gòu),先介紹一下caffe.proto,是google開源的一種數(shù)據(jù)交互格式--Google Protobuf,這種數(shù)據(jù)的格式,我們可以看到caffe.proto中內(nèi)容:
syntax = "proto2"; package caffe; //caffe.prto中的各個結(jié)構(gòu)封裝在caffe包中,可以通過using namespace caffe; 或者caffe::** 調(diào)用// Specifies the shape (dimensions) of a Blob.message BlobShape { repeated int64 dim = 1 [packed = true]; } message BlobProto { optional BlobShape shape = 7; repeated float data = 5 [packed = true]; repeated float diff = 6 [packed = true]; repeated double double_data = 8 [packed = true]; repeated double double_diff = 9 [packed = true]; // 4D dimensions -- deprecated. Use&nbs