使用Fast RCNN跑通Demo
来源:互联网 发布:淘宝扫码支付 编辑:程序博客网 时间:2024/05/17 02:40
参考:http://www.cnblogs.com/louyihang-loves-baiyan/p/4885659.html
- 下载源码
git clone --recursive https://github.com/rbgirshick/fast-rcnn.git
- 下载预训练模型
cd fast-rcnn
执行以下命令
这个fetch_fast_rcnn_models.sh文件就是帮你下载模型的。
下载下来的模型会放在
fast-rcnn/data/fast_rcnn_models文件夹下面
(fast-rcnn为克隆下来的根目录) - 配置相应的文件
cd fast-rcnn/caffe-fast-rcnn
执行命令
cp Makefile.config.example Makefile.config
然后
sudo gedit Makefile.config进行以下修改然后保存退出
取消注释:USE_CUDNN = 1
WITH_PYTHON_LAYER = 1
USE_PKG_CONFIG = 1
修改路径
INCLUDE_DIRS 应该添加上 /usr/include/hdf5/serial
LIBRARY_DIRS 添加上 /usr/lib/x86_x64-linux-gnu/hdf5/serial - 编译Cython module
cd fast-rcnn/lib - 编译caffe和pycaffe
cd fast-rcnn/caffe-fast-rcnn
make
make的时候可能会出现如下错误:
n@kevin:~/fast-rcnn/caffe-fast-rcnn$ make
PROTOC src/caffe/proto/caffe.proto
CXX .build_release/src/caffe/proto/caffe.pb.cc
CXX src/caffe/common.cpp
In file included from ./include/caffe/util/device_alternate.hpp:40:0,
from ./include/caffe/common.hpp:19,
from src/caffe/common.cpp:5:
./include/caffe/util/cudnn.hpp: In function ‘void caffe::cudnn::createPoolingDesc(cudnnPoolingStruct**, caffe::PoolingParameter_PoolMethod, cudnnPoolingMode_t*, int, int, int, int, int, int)’:
./include/caffe/util/cudnn.hpp:124:41: error: too few arguments to function ‘cudnnStatus_t cudnnSetPooling2dDescriptor(cudnnPoolingDescriptor_t, cudnnPoolingMode_t, cudnnNanPropagation_t, int, int, int, int, int, int)’
pad_h, pad_w, stride_h, stride_w));
^
./include/caffe/util/cudnn.hpp:12:28: note: in definition of macro ‘CUDNN_CHECK’
cudnnStatus_t status = condition; \
^
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/common.cpp:5:
/usr/local/cuda/include/cudnn.h:803:27: note: declared here
cudnnStatus_t CUDNNWINAPI cudnnSetPooling2dDescriptor(
^
Makefile:501: recipe for target '.build_release/src/caffe/common.o' failed
make: *** [.build_release/src/caffe/common.o] Error 1
解决办法:参考:http://blog.csdn.net/errors_in_life/article/details/70916583
进入自己根目录下原来的Caffe下面拷贝相应的文件进入caffe-fast-rcnn1.将./include/caffe/util/cudnn.hpp 换成最新版的caffe里的cudnn的实现,即相应的cudnn.hpp.
2. 将./include/caffe/layers文件夹整个拷贝到对应的caffe-fast-rcnn里的include/caffe目录下,缺少该文件夹
3.将./src/caffe/layer里的,所有以cudnn开头的文件,例如cudnn_lrn_layer.cu,cudnn_pooling_layer.cpp,cudnn_sigmoid_layer.cu。
都替换成最新版的caffe里的相应的同名文件。
然后重新编译,解决
make pycaffe - 运行Demo文件
cd fast-rcnn/tools
python demo.py --net caffenet
OK!
可能出现的错误:
LD -o .build_release/lib/libcaffe.so
/usr/bin/ld: 找不到 -lhdf5_hl
collect2: error: ld returned 1 exit status
Makefile:493: recipe for target '.build_release/lib/libcaffe.so' failed
解决办法:
修改caffe-fast-rcnn下的Makefile.config//重要的一项将# Whatever else you find you need goes here.下面的INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/includeLIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib修改为:INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serialLIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/hdf5/serial//这是因为ubuntu16.04的文件包含位置发生了变化,尤其是需要用到的hdf5的位置,所以需要更改这一路径
cd /usr/lib/x86_64-linux-gnu\\然后根据情况执行下面两句:sudo ln -s libhdf5_serial.so.10.1.0 libhdf5.sosudo ln -s libhdf5_serial_hl.so.10.0.2 libhdf5_hl.so
阅读全文
0 0
- 使用Fast RCNN跑通Demo
- fast-RCNN跑通Demo
- Fast-RCNN安装与使用(跑demo)
- fast rcnn 安装 demo测试
- Fast-rcnn 训练(2)- 跑demo
- Fast RCNN
- Fast-RCNN
- Fast-RCNN
- Fast-RCNN
- Fast RCNN
- Fast RCNN
- Fast RCNN
- FAST RCNN demo.py问题汇总和解决!
- fast-rcnn配置运行demo.py(Ubuntu14.04)
- fast-rcnn配置运行demo.py(Ubuntu14.04)
- fast-rcnn配置运行demo.py(Ubuntu14.04)
- fast rcnn的安装与使用
- RCNN,Fast-RCNN,Faster-RCNN
- 构建Linux根文件系统(三)
- Eclipse与intelliJ IDEA 的区别(个人见解)
- Kotlin上线啦!!!
- Linux CentOS7 发送QQ邮件问题解决方案
- 在linux搭建博客(1)
- 使用Fast RCNN跑通Demo
- XStream 通过对象流进行对象与xml的序列化和反序列化
- cxfSpring集合例子
- 店铺卖家的描述信息爬取
- Can not find the tag library descriptor for "http://java.sun.com/jsp/jstl/core
- Linux服务器编程——Linux系统编程之进程
- 工作流基本概念__了解就行
- angular js基础点滴
- Spark:Scala实现常用的Transformation操作