基於caffe的Faster-rcnn 編譯出錯

由於原作者的cudnn跟小C的不同,小C是cudnn 5,所以makefile.config的cudnn需要註釋掉,也就是說不能使用GPU。

編譯make -j8 && make pycaffe時出錯
1 make: *** No rule to make target '–j8'。 停止。
發現是命令輸入錯誤,應該是make -j8 && make pycaffe,氣死了!這種錯誤。。。

2 裝好前面python-opencv庫會解決caffe.pb.h丟失問題

3 Makefile:563: recipe for target '.build_release/tools/extract_features.bin' failed
make: *** [.build_release/tools/extract_features.bin] Error 1

解決:把原來caffe的makefile.config中的cudnn也註釋掉,兩邊的設置一樣。

4 Makefile:568: recipe for target '.build_release/examples/mnist/convert_mnist_data.bin' failed
make: *** [.build_release/examples/mnist/convert_mnist_data.bin] Error 1
Makefile:563: recipe for target '.build_release/tools/compute_image_mean.bin' failed
make: *** [.build_release/tools/compute_image_mean.bin] Error 1

考慮是編碼問題,可能多了空格,在window下查看並沒有,排除。
是opencv不對,在faster-rcnn的makefile.config中添加OPENCV_VERSION := 3,然後又報錯
.build_release/lib/libcaffe.so:對‘mdb_cursor_open’未定義的引用
.build_release/lib/libcaffe.so:對‘cv::resize(cv::_InputArray const&, cv::_OutputArray const&, cv::Size_<int>, double, double, int)’未定義的引用
Makefile:563: recipe for target '.build_release/tools/upgrade_net_proto_binary.bin' failed
make: *** [.build_release/tools/upgrade_net_proto_binary.bin] Error 1

發現一個方法,在 makefile.config裏面加一個LIBRARIES直接加在opencv下面,如下

# Uncomment if you‘re using OpenCV 3
OPENCV_VERSION := 3
LIBRARIES += glog gflags protobuf leveldb snappy lmdb boost_system hdf5_hl hdf5 m opencv_core opencv_highgui opencv_imgproc opencv_imgcodecs

再次編譯通過了!
感謝http://www.bubuko.com/infodetail-2038229.html作者!

跑數據出錯:/lib/rpn/proposal_layer.py", line 26, in setup
layer_params = yaml.load(self.param_str)
AttributeError: 'ProposalLayer' object has no attribute 'param_str'

解決:把param_str改爲param_str_。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章