zoukankan      html  css  js  c++  java
  • py-faster-rcnn +cudnn V5

    转载自http://blog.csdn.net/u010733679/article/details/52221404,经过实际操作,采用了第二种手动替换代码文件、修改个别函数名的方式,成功编译。

    ---- 原文 -----

    faster rcnn 代码默认是使用的cudnn v4, 但是为了体验最新的v5, 或者使用GTX1080 ,我们编译faster rcnn的时候就会报错:

    In file included from ./include/caffe/util/cudnn.hpp:5:0,
    from ./include/caffe/util/device_alternate.hpp:40,
    from ./include/caffe/common.hpp:19,
    from src/caffe/data_reader.cpp:6:
    /usr/local/cuda/include/cudnn.h:799:27: note: declared here
    cudnnStatus_t CUDNNWINAPI cudnnSetPooling2dDescriptor(

    为此提供2种解决方案:

    (1)取自github @manipopopo

    cd caffe-fast-rcnn
    Git remote add caffe https://github.com/BVLC/caffe.git
    git fetch caffe
    git merge caffe/master
    Remove self_.attr("phase") = static_cast(this->phase_); from include/caffe/layers/python_layer.hpp after merging.

    (2)手动修改文件,参考了卜居大神的博客 http://blog.csdn.net/kkk584520/article/details/51163564
    方案1简单方便,但是当我们编译的是其他人修改过得源码,可能就会出错。方案2 步骤如下:

    1. 用最新caffe源码的以下文件替换掉faster rcnn 的对应文件

    include/caffe/layers/cudnn_relu_layer.hpp, src/caffe/layers/cudnn_relu_layer.cpp, src/caffe/layers/cudnn_relu_layer.cu

    include/caffe/layers/cudnn_sigmoid_layer.hpp, src/caffe/layers/cudnn_sigmoid_layer.cpp, src/caffe/layers/cudnn_sigmoid_layer.cu

    include/caffe/layers/cudnn_tanh_layer.hpp, src/caffe/layers/cudnn_tanh_layer.cpp, src/caffe/layers/cudnn_tanh_layer.cu

    1. 用caffe源码中的这个文件替换掉faster rcnn 对应文件

    include/caffe/util/cudnn.hpp

    1. 将 faster rcnn 中的 src/caffe/layers/cudnn_conv_layer.cu 文件中的所有

    cudnnConvolutionBackwardData_v3 函数名替换为 cudnnConvolutionBackwardData
    cudnnConvolutionBackwardFilter_v3函数名替换为 cudnnConvolutionBackwardFilter

  • 相关阅读:
    moss文档库操作的几个类
    Infopath web浏览中的多项选择功能
    国际软件项目经理的七大素质转
    InfoPath中的Rich Text Box中如何加“回车”
    设计模式——策略模式
    设计模式——状态模式
    设计模式——备忘模式
    设计模式——中介者模式
    关与BaseDataList类型绑定ArrayList
    设计模式——命令模式
  • 原文地址:https://www.cnblogs.com/zjutzz/p/6099720.html
Copyright © 2011-2022 走看看