Caffe編譯錯誤整理

2022-05-30 14:06:08 字數 2641 閱讀 8434

今天編譯caffe-ssd遇到編譯錯誤:

1   line 9690: 3>e:\github\caffe-ssd-windows\src\caffe\layer_factory.cpp(141): error c2061: syntax error: identifier '

slicelayer

'2 line 9690: 3>e:\github\caffe-ssd-windows\src\caffe\layer_factory.cpp(141): error c2061: syntax error: identifier '

slicelayer

'3 line 9696: 3>e:\github\caffe-ssd-windows\src\caffe\layer_factory.cpp(262): error c2061: syntax error: identifier '

normalizelayer

'4 line 9696: 3>e:\github\caffe-ssd-windows\src\caffe\layer_factory.cpp(262): error c2061: syntax error: identifier '

normalizelayer

'5 line 9702: 3>e:\github\caffe-ssd-windows\src\caffe\layer_factory.cpp(272): error c2061: syntax error: identifier '

innerproductlayer

'6 line 9702: 3>e:\github\caffe-ssd-windows\src\caffe\layer_factory.cpp(272): error c2061: syntax error: identifier '

innerproductlayer

'7 line 10141: 4>link : fatal error lnk1104: cannot open file

'..\lib\debug\caffe-d.lib

'

經查,是下面檔案裡沒有新增上面對應的三個標頭檔案。

新增下面三行到layer_factory.cpp:

#include "

caffe/layers/slice_layer.hpp

"#include

"caffe/layers/normalize_layer.hpp

"#include

"caffe/layers/inner_product_layer.hpp

"

再次編譯,報錯:

e:\github\caffe-ssd-windows\src\caffe\layer_factory.cpp(265): error c2955: 'caffe::normalizelayer': use of class template requires template argument list

e:\github\caffe-ssd-windows\include\caffe/layers/normalize_layer.hpp(18): note: see declaration of 'caffe::normalizelayer'

e:\github\caffe-ssd-windows\src\caffe\layer_factory.cpp(267): note: see reference to function template instantiation 'boost::shared_ptr> caffe::getnormalizelayer(const caffe::layerparameter &)' being compiled

with

[dtype=float

]e:\github\caffe-ssd-windows\src\caffe\layer_factory.cpp(265): error c2514: 'caffe::normalizelayer': class has no constructors

e:\github\caffe-ssd-windows\include\caffe/layers/normalize_layer.hpp(18): note: see declaration of 'caffe::normalizelayer'

e:\github\caffe-ssd-windows\src\caffe\layer_factory.cpp(275): error c2514: 'caffe::innerproductlayer': class has no constructors

查詢原因:

return shared_ptr>(new normalizelayer(param));

改為(新增了):

return shared_ptr>(new normalizelayer(param));
將:

return shared_ptr>(new innerproductlayer(param));
改為(新增了):

return shared_ptr>(new innerproductlayer(param));
然後就編譯通過了。

caffe編譯錯誤總結

問題1 fatal error hdf5.h 沒有那個檔案或目錄 在makefile.config檔案,新增 usr include hdf5 serial 到 include dirs,也就是把下面第一行 改為第二行 include dirs python include usr local in...

ubuntu下caffe編譯錯誤彙總

題記 林林總總,編譯了不下十次,安裝系統,配顯示卡,驅動,cuda,cudnn也不下於七八次,每次都會有相同或者不同的錯誤,之前一直偷懶沒有記錄,導致每次都要重新搜,實為不便,在此記錄,回憶到就更。1.編譯caffe,在make all的時候報錯 caffe usr bin ld 找不到 lopen...

makefile編譯錯誤情況整理

錯誤情況1 makefile 5 遺漏分隔符 停止 原因 具體的編譯動作,開頭不可以有空格,留白是由 按tab鍵形成的。解決方法 去掉空格,改為tab鍵後,再執行make命令,成功。錯誤情況2 eh frame 0x12 undefined reference to gxx personality ...