GPU (CUDA 8.0,Cudnn5.1 ) Faster-rcnn

caffe都弄好的情况下~~~~(现在的版本faster-rcnn据说只支持cudnn 3版本的,所以在这之上要是想使用cudnn的都需要经过替换文件,下面有提到)

特别注意,你每一次编译的时候都需要把之前编译好的文件清除,否则编译不成功,在 ~/py-faster-rcnn/caffe-fast-rcnn下执行 make clean 操作就是清除上一次编译(没有成功的编译在你希望重新编译的时候都需要make clean)

一:

Clone the Faster R-CNN repository

# Make sure to
clone with --recursive
git clone
--recursive https://github.com/rbgirshick/py-faster-rcnn.git
  • We'll call the directory that you cloned Faster R-CNN intoFRCN_ROOT

Ignore notes 1 and 2 if you followedstep 1 above.

Note 1:If you didn't clone Faster R-CNN with the--recursiveflag, then you'll need to manually clone thecaffe-fast-rcnnsubmodule:

git submodule
update --init --recursive

Note 2:Thecaffe-fast-rcnn sub moduleneeds to be on the faster-rcnn branch(or equivalent detached state). This will happen automaticallyifyou followed step 1 instructions.

上面就是官方文档给出的正确clonefasterrcnn的方法和如果不按照这个给定方法执行所产生的后果:漏装了caffe-fast-rcnn(这个文件在后面很重要,如果没有它,下面的工作无法执行)

二:

下载demo模型数据

cd $FRCN_ROOT
$
./data/scripts/fetch_faster_rcnn_models.sh

This will populate the $FRCN_ROOT/datafolder withfaster_rcnn_models. Seedata/README.md for details. These modelswere trained on VOC 2007 trainval.

py-faster-rcnn的路径下找到执行后面到文件./data/scripts/fetch_faster_rcnn_models.sh,所下载的模型会放在py-faster-rcnn的路径下的data文件夹下,名为faster_rcnn_models.(其实也可以不用执行指令下载的,你可以在其他地方下载好了,放在data目录下就好了~)

三:

修改文件:

1.  执行:cp Makefile.config.exampleMakefile.config (caffe-fast-rcnn目录下)

$ cp Makefile.config.exampleMakefile.config(caffe-fast-rcnn目录下)

2.  打开Makefile.config:文件找到相应的地方添加下面的黄色的内容,修改

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/hdf5/serial/

保存退出,注意新加的内容和原来的有空格隔开

否则会出现什么hdf5.o文件找不到~

3.  更改Makefile.config文件:去掉use_cudnn前面的注释 #

#Unrelatedly, it's also recommended that you use CUDNN

USE_CUDNN:= 1

4.  因为这个版本所用的cudnn为旧版本的,可能与新环境的cudnn不兼容

 所以你需要:

1)./py-faster-rcnn/caffe-fast-rcnn/include/caffe/util/cudnn.hpp换成最新版的caffe里的cudnn的实现,即相应的cudnn.hpp.

)./py-faster-rcnn/caffe-fast-rcnn/include/caffe/layers中所有以cudnn开头的文件都(建议到该目录下了之后,使用文件搜索功能替换)用最新caffe源码的以下文件替换掉fasterrcnn的对应文件(一般在caffe目录下的相同目录下:~caffe/include/caffe/layersxx文件)

)./py-faster-rcnn/caffe-fast-rcnn/src/caffe/layers中所有以cudnn开头的文件都(建议到该目录下了之后,使用文件搜索功能替换)用最新caffe(就是贾阳青的那个框架里面的文件)源码的中对应文件替换掉(一般在caffe目录下的相同目录下:~caffe/src/caffe/layersxx文件)

注意是所有文件哦~所有以cudnn开头的文件拉~

否则导致出现如下错误:

In file includedfrom ./include/caffe/util/device_alternate.hpp:40:0,

from ./include/caffe/common.hpp:19,

from ./include/caffe/blob.hpp:8,

from ./include/caffe/layer.hpp:8,

from src/caffe/layer_factory.cpp:8:

./include/caffe/util/cudnn.hpp:In function ‘voidcaffe::cudnn::createPoolingDesc(cudnnPoolingStruct**,caffe::PoolingParameter_PoolMethod, cudnnPoolingMode_t*, int, int,int, int, int, int)’:

./include/caffe/util/cudnn.hpp:127:41: error:too few arguments to function ‘cudnnStatus_t

5.Makefile.config文件中的WITH_PYTHON_LAYER:= 1前面的注释#去掉~

WITH_PYTHON_LAYER:= 1 (Makefile.config文件中)

一定要注意把这个的注释也去掉了,否则下面会出现这种类似的问题(也就是去掉“# ”)

( 类似的问题:

F110302:52:40.782572 12953 layer_factory.hpp:81] Check failed:registry.count(type) == 1 (0 vs. 1) Unknown layer type: Python (knowntypes: AbsVal, Accuracy, ArgMax, BNLL, BatchNorm, BatchReindex, Bias,Concat, ContrastiveLoss, Convolution, Data, Deconvolution, Dropout,DummyData, ELU, Eltwise, Embed, EuclideanLoss, Exp, Filter, Flatten,HDF5Data, HDF5Output, HingeLoss, Im2col, ImageData, InfogainLoss,InnerProduct, LRN, Log, MVN, MemoryData, MultinomialLogisticLoss,PReLU, Pooling, Power, ROIPooling, ReLU, Reduction, Reshape, SPP,Scale, Sigmoid, SigmoidCrossEntropyLoss, Silence, Slice,SmoothL1Loss, Softmax, SoftmaxWithLoss, Split, TanH, Threshold, Tile,WindowData)

*** Check failurestack trace: ***

)

6.安装easydict

$ sudo pip installl easydict (ubuntu根目录下执行,其实哪里执行都ok吧)

一般不建议这样子安装,因为很多时候会出现问题,建议自己去下载压缩包,解压,cd到解压后的文件目录下,你就会看到setup.py文件,在该目录下执行

$ sudo pythonsetup.py install 就可以安装这个库了(这是必须要的库文件,否则编译的时候会出现类似说没有easydict库文件的问题)

不建议使用$ python setup.pyinstall来安装setup.py,因为我遇到过下面这种问题

( 

siahooar@siahooar:~/pip-1.5.6$python setup.py install

running install

error:can't create or remove files in install directory

siahooar@siahooar:~/pip-1.5.6$sudo python setup.py install (换成sudoxxx 就好了)

running install

running bdist_egg

running egg_info

四。

编译Cpython(Build the Cython modules)

$ cd $FRCN_ROOT/lib (py-faster-rcnn/lib目录下)

$ make
五。
编译caffe-fast-rcnn
(Build Caffe and pycaffe)
cd
$FRCN_ROOT/caffe-fast-rcnn (py-faster-rcnn/caffe-fast-rcnn目录下)

然后在该目录下执行:make–j4 && make pycaffe

$ make -j4 &&
make pycaffe
六:
运行程序自带的一个例子验证你的faster-rcnn
$ cd py-faster-rcnn
$ ./tools/demo.py
后面就不贴图了 成功了都一样

使用gpu(gtx1080) cudnn 5.1下编译faster rcnn相关推荐

  1. [深度学习] RCNNs系列(1) Ubuntu下Faster RCNN配置及训练和测试自己的数据方法

    最近用到Faster RCNN进行目标检测,前前后后两周把RCNN,SPPNet,Fast RCNN和Faster RCNN大体调查了一遍,准备写一个RCNNs系列,后面还要加上今年最新的Mask R ...

  2. Ubuntu 16.04 LTS下编译GPU版tensorflow

    Ubuntu 16.04 LTS下编译GPU版tensorflow 机器学习与数学 · 2016-06-10 13:51 作者: 比特小组 机器学习与数学出品 机器学习必然涉及到代码,本小组选择sci ...

  3. MAC OS下编译tensorflow 2.4.1 - 支持GPU CUDA 10.1和AVX2 FMA

    步骤 1. 为什么要自己编译tensorflow? 2. 编译环境 2.1 安装所需软件 3. 编译步骤 3.1 安装python包 3.2 克隆代码 3.3 修改代码 3.4 配置编译选项 3.5 ...

  4. 真实机下 ubuntu 18.04 安装GPU +CUDA+cuDNN 以及其版本选择(亲测非常实用)【转】...

    本文转载自:https://blog.csdn.net/u010801439/article/details/80483036 ubuntu 18.04 安装GPU +CUDA+cuDNN : 目前, ...

  5. Windows下编译tensorflow-gpu教程

    这两个也要看: https://zhuanlan.zhihu.com/p/29029860 https://zhuanlan.zhihu.com/p/34942873 Windows下编译tensor ...

  6. Caffe实战二(手写体识别例程:CPU、GPU、cuDNN速度对比)

    上一篇文章成功在CPU模式下编译了Caffe,接下来需要运行一个例程来直观的了解Caffe的作用.(参考:<深度学习 21天实战Caffe>第6天 运行手写体数字识别例程) 编译步骤: C ...

  7. 超级详细Ubuntu20.04.5系统下编译安装OpenCV with ffmpeg4.2.7、NVIDIA显卡驱动515、cuda11.5、cudnn8.3.3并编译使用darknet-yolov4

    这篇文章是本人折腾了两天之后将步骤捋顺然后记录一下.如果你的电脑刚刚装好系统,想要安装显卡驱动.编译安装ffmpeg.编译安装cuda与cudnn.编译安装opencv再或者想要使用darknet-y ...

  8. windows下编译darknet

    目录 windows下编译darknet 换了编译方案 windows下编译darknet 使用vs2015 配置失败 疯狂报错有位置引用错误 配置环境 cuda版本11.6 报错如下 C:\Prog ...

  9. Faster R-CNN python版在Ubuntu16.04环境下配置编译

    Faster R-CNN python版在Ubuntu16.04环境下配置编译 1 电脑配置 2 安装显卡驱动 3 安装CUDA 3.1 安装CUDA 3.2 安装CUDNN 3.3 Samples测 ...

最新文章

  1. PowerShell通过安全组创建计算机账号
  2. node学习准备工作1 --- nvm下载、终端环境iterm2配置
  3. JAVA实现https单向认证
  4. 如何高效备考信息系统项目管理师?
  5. 策小编脑中的“私有化部署”
  6. Linux的inode的理解
  7. CodeForces - 1196F K-th Path(最短路+思维)好题
  8. python爬取数据保存为csv时生成编号_将爬取到到数据以CSV格式存储
  9. Eclipse+PyDev 安装和配置(转)
  10. IntelliJ IDEA导出设置
  11. 个人名义申请的支付接口。支付聚合网站汇总
  12. 29.Jwt集成(3):token设置过期时间、异常判断
  13. php短网址案例,php 短网址小例子
  14. 贺利坚老师汇编课程56笔记:CMP指令
  15. LeetCode Remove K Digits
  16. 2.程序员的自我修养---编译和链接
  17. 注塑机c语言程序,注塑机PLC程序(完整版).docx
  18. STK和c语言集成开发,STKX组件实现c#与stk的集成.pdf
  19. 网易公开课斯坦福大学-机器学习
  20. T检验、F检验和统计学意义(P值或sig值)

热门文章

  1. Boost.MultiIndex 复合键的例子
  2. boost::intrusive::derivation_value_traits用法的测试程序
  3. boost::describe模块和boost::json混合编程的测试程序
  4. boost::contract模块实现lambda表达式的测试程序
  5. Boost:字符串转换实例
  6. Boost:字符串替换的测试程序
  7. VTK:Rendering之HiddenLineRemoval
  8. VTK:Points之MaskPointsFilter
  9. VTK:相互作用之Game
  10. OpenCV计算机视觉应用程序的交互式视觉调试