运行iResNet教程

Git網址:https://github.com/leonzfa/iResNet

 

首先安装caffe,安装过程请参考:

https://blog.csdn.net/zhuiqiuzhuoyue583/article/details/88756053

我已经安装cuda8.0,cudnn5.1,opencv3.1,caffe1.0.0

 

下載源代碼:https://github.com/leonzfa/iResNet.git

 

將文件命名爲“iResNet”,在iResNet目錄下,進行編譯。

cd iResNet

sudo make clean

sudo make all -j 12 tools

 

问题1:/usr/include/opencv2/gpu/gpu.hpp(438): error: vector is not a template

解决方法:

iResNet/src/caffe/layers/resample_layer.cu中的

  #include <opencv2/gpu/gpu.hpp> 注释掉

即:

//#include <opencv2/gpu/gpu.hpp>

或者 在 #include <opencv2/gpu/gpu.hpp> 上面一行加上 using namespace std;  (我用的此方法)

即:

using namespace std;
#include <opencv2/gpu/gpu.hpp>

 

參考:https://github.com/liruoteng/FlowNet/issues/11

           https://blog.csdn.net/qq_34570910/article/details/78245706

            https://stackoverflow.com/questions/26121604/opencv-2-4-9-compilation-error-with-cuda-6-5/29916815

 

问题2:tools/convert_imageset_and_disparity.cpp:156:31: error: ‘numeric_limits’ is not a member of ‘std’
                         value=std::numeric_limits<short>::max();

解决方法:

tools/convert_imageset_and_disparity.cpp 中添加

#include <limits>

注意,這裏會出現多個”‘numeric_limits’ is not a member of ‘std’
                                         value=std::numeric_limits<short>::max();“

需要在相應的cpp文件中添加 ”#include <limits>“

參考:https://github.com/opencv/opencv_contrib/issues/836

            https://github.com/lmb-freiburg/flownet2/issues/75

            https://blog.csdn.net/shanpenghui/article/details/79487015

            https://blog.csdn.net/midi666/article/details/83151729

            https://www.cnblogs.com/Jacket-K/p/9830239.html

 

ubuntu16.04 使用C++11:https://blog.csdn.net/zhuiqiuzhuoyue583/article/details/88903719

 

问题3:.build_release/lib/libcaffe.so: undefined reference to `cv::imread(cv::String const&, int)'

报错原因:
 

解决方法:

     在“Makefile.config”中默认使用的是opencv2,因此出现这个错误。

     Makefile.config中OPENCV_VERSION := 3取消注释(亲测可用,建議使用這種方法)

 

或者

    很明显是OpenCV出了问题,网上查阅后,得知是因为lib文件opencv_imgcodecsMakefile文件中未添加,修改如下:

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

此外,还有一些Makefile文件这么写,也是可行的:

ifeq ($(USE_OPENCV), 1)
    LIBRARIES += opencv_core opencv_highgui opencv_imgproc 

    ifeq ($(OPENCV_VERSION), 3)
        LIBRARIES += opencv_imgcodecs
    endif

endif

參考:https://blog.csdn.net/u011636440/article/details/82660697

            https://blog.csdn.net/YhL_Leo/article/details/52150781

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值