Fast R-CNN/Faster R-CNN:编译Caffe and pycaffe存在的BUG

Bug 1、./include/caffe/util/hdf5.hpp:6:18: fatal error: hdf5.h: No such file or directory

Solution:(1)在Makefile.config修改INCLUDE_DIRS和LIBRARY_DIRS,分别添加” /usr/include/hdf5/serial/“和”/usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/hdf5/serial“;

INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include    /usr/include/hdf5/serial/

LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib  /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/hdf5/serial


(2)在Makefile修改LIBRARIES,将”hdf5_hl“ 和”hdf5“分别修改为”hdf5_serial_hl“和 ”hdf5_serial“。 (Faster -RCNN 可以忽略)

LIBRARIES += glog gflags protobuf boost_system boost_filesystem m hdf5_hl hdf5
LIBRARIES += glog gflags protobuf boost_system boost_filesystem m hdf5_serial_hl hdf5_serial

Bug 2、.build_release/lib/libcaffe.so: undefined reference to cv::imread(cv::String const&, int)' .build_release/lib

Solution:在Makefile中的LIBRARIES中添加“opencv_imgcodecs”。

            LIBRARIES += glog gflags protobuf leveldb snappy \
                 lmdb boost_system hdf5_serial_hl  hdf5_serial m \
                opencv_core opencv_highgui opencv_imgproc opencv_imgcodecs

注意:此时,如果继续使用make -j8 && make pycaffe(make all 会导致运行demo.py报错)命令行,会出现相同情况的bug。所以你需要删除在build中的所有文件(命令:rm -rf ./build/*),然后执行make -j8 && make pycaffe命令行,就没问题了。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值