Faste R-CNN的安装及测试

一、拉取源码


下载 fast-rcnn

因下载解压后 caffe-fast-rcnn是空文件夹,故需要单独下
caffe-fast-rcnn-bcd9b4eadc7d8fbc433aeefd564e82ec63aaf69c.zip

unzip caffe-fast-rcnn-bcd9b4eadc7d8fbc433aeefd564e82ec63aaf69c.zip
cp ./caffe-fast-rcnn-bcd9b4eadc7d8fbc433aeefd564e82ec63aaf69c/ /home/cmwang/fast-rcnn-master/caffe-fast-rcnn/

二、copy缺失文件夹


因编译中出现缺失layer的问题,故需要copy缺失文件夹layers(caffe-fast-rcnn/include/caffe/ 无 layers文件夹)

可直接从caffe-master中copy或者从

cp /home/cmwang/caffe-master/include/caffe/layers/ /home/cmwang/fast-rcnn-master/caffe-fast-rcnn/include/caffe/layers/或者
cp /home/cmwang/py-faster-rcnn/caffe-fast-rcnn/include/caffe/layers/ /home/cmwang/fast-rcnn-master/caffe-fast-rcnn/include/caffe/layers/

三、修改Makefile文件


终端输入

cd /home/cmwang/fast-rcnn-master/caffe-fast-rcnn/ 
cp Makefile.config.example Makefile.config #备份Makefile 
gedit Makefile.config

使用Python层
将# WITH_PYTHON_LAYER := 1修改为 WITH_PYTHON_LAYER := 1

调用matlab
将#MATLAB_DIR := / usr/local/MATLAB/R2015b 中的#去掉。

使用cudnn加速
将# USE_CUDNN := 1修改为USE_CUDNN := 1

保留# CPU_ONLY := 1不变,使用GPU运行faster r-cnn

四、编译Cython模块


终端输入

cd ~/caffe-fast-rcnn/lib/
make

五、编译caffe和pycaffe & matcaffe


终端输入

cd ~/caffe-fast-rcnn/caffe-fast-rcnn/ 
make -j8 && make pycaffe && make matcaffe

六、下载模型


终端输入

cd ~/caffe-fast-rcnn/./data/scripts/fetch_faste_rcnn_models.sh 

七、Demo测试


终端输入

cd ~/caffe-fast-rcnn/./tools/demo.py

出现的问题1

caffe —找不到lhdf5_hl和lhdf5的错误

解决方法:

cd 
gedit Makefile.config

INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib

修改为

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

这是因为ubuntu16.04的文件包含位置发生了变化,尤其是需要用到的hdf5的位置,所以需要更改这一路径

建立软连接

cd /usr/lib/x86_64-linux-gnu
sudo ln -s libhdf5_serial.so.8 libhdf5.so
sudo ln -s libhdf5_serial_hl.so.8.0.2 libhdf5_hl.so

出现的问题2

When use fast R-CNN, got error like this:

I0310 08:26:43.672577 144950 net.cpp:340] Input 0 -> data
I0310 08:26:43.672601 144950 net.cpp:340] Input 1 -> rois
I0310 08:26:43.672621 144950 layer_factory.hpp:74] Creating layer conv1
I0310 08:26:43.672639 144950 net.cpp:84] Creating Layer conv1
I0310 08:26:43.672650 144950 net.cpp:380] conv1 <- data
I0310 08:26:43.672664 144950 net.cpp:338] conv1 -> conv1
I0310 08:26:43.672680 144950 net.cpp:113] Setting up conv1
Floating point exception(core dumped).

解决方案

gedit lib/fast_rcnn/train.py

添加 filter_roidb 范围,示范如下

def filter_roidb(roidb):"""Remove roidb entries that have no usable RoIs."""def is_valid(entry):# Valid images have:#   (1) At least one foreground RoI OR#   (2) At least one background RoIoverlaps = entry['max_overlaps']# find boxes with sufficient overlapfg_inds = np.where(overlaps >= cfg.TRAIN.FG_THRESH)[0]# Select background RoIs as those within [BG_THRESH_LO, BG_THRESH_HI)bg_inds = np.where((overlaps < cfg.TRAIN.BG_THRESH_HI) &(overlaps >= cfg.TRAIN.BG_THRESH_LO))[0]# image is only valid if such boxes existvalid = len(fg_inds) > 0 or len(bg_inds) > 0return validnum = len(roidb)filtered_roidb = [entry for entry in roidb if is_valid(entry)]num_after = len(filtered_roidb)print 'Filtered {} roidb entries: {} -> {}'.format(num - num_after,num, num_after)return filtered_roidb

It’s like something about box size. the solution is add filter_roidb function in lib/fast_rcnn/train.py file, like here.
Reference: https://github.com/rbgirshick/py-faster-rcnn/issues/159

其他的相关问题可参考
Faster R-CNN的安装及测试中常出现问题部分。


参考文献

caffe —找不到lhdf5_hl和lhdf5的错误

fast-rcnn github

fast-rcnn caffe-fast-rcnn

安装和运行Fast R-CNN的demo

caffe compilation troubleshooting

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/246864.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

6 areas of artificial intelligence to watch closely 需要密切关注的六大人工智能/机器学习领域

近段时间&#xff0c;有许多关于人工智能公认定义的争论。有些人认为人工智能就是“认知计算”或是“机器智能”&#xff0c;而另一些人则把它与“机器学习”的概念混淆了。然而&#xff0c;人工智能并不是特指某种技术&#xff0c;它实际上是一个由多门学科组成的广阔领域&…

2016 亚洲共识指南:肺结节的评估

2016 年 2 月&#xff0c;亚洲肺部疾病和胸外科多学科专家小组在美国胸科医师学会&#xff08;ACCP&#xff09;制定的肺结节评估指南的基础上结合亚洲患者的自身特点制订了亚洲肺结节患者的评估指南。 亚洲肺结节的评估与 APCC 指南中所指出的重要注意事项大致相同。但该指南…

Ubuntu 15.04 安装TensorFlow(源码编译) 及测试梵高作画

介绍Google的TensorFlow机器学习开源库&#xff0c;在UbuntuKylin上的安装和和源码编译。 原始官方文档参见&#xff1a;http://www.tensorflow.org. 本电脑配置如下&#xff1a; 3.19.0-15-generic #15-Ubuntu x86_64 GNU/Linux NVIDIA Corporation GK110BGL [Tesla K40c] …

Ubuntu 15.04 安装 boost-python

1. 安装依赖库 sudo apt-get install python-dev sudo apt-get install mpi-default-dev #安装mpi库 sudo apt-get install libicu-dev #支持正则表达式的&#xff35;&#xff2e;&#xff29;&#xff23;&#xff2f;&#xff24;&#xff25;字符集 sudo apt-get install …

python 常见问题汇总(待续)

1. No module named skimage pip install scikit-image --upgrade 2. No module named dicom sudo pip install pydicom 3. python name ‘os’ is not defined import os This will import the python’s module os, which apparently is used later in the code of your m…

如何将 ipynb 发布到 blog 中(html, markdown格式)

相关文章链接 如何向IPython Notebook中导入.py文件 如何将 ipynb 发布到 blog 中(html, markdown格式) Introducing IPython Notebook Beginner’s IPython Notebook Tutorial Example notebook showing how to do statistics in IPython Notebook next generation slide…

HP Z840 工作站配sSAS Raid 安装 Ubuntu 16.04 系统

惠普Z840工作站配SAS RAID安装win7系统加载驱动 安装ubuntu的最低版本版本要求是01.25&#xff0c;请更新到官方最新的02.31测试 1. BIOS系统更新 1. 准备好一个空的U盘&#xff0c;格式化成FAT32&#xff0c;在U盘上建立\Hewlett-Packard\BIOS\New 2. 下载链接http://ftp.hp…

Ubuntu SSH Algorithm negotiation failed

问题 解决方法 chmod 777 /etc/ssh/sshd_configgedit /etc/ssh/sshd_config添加如下 Ciphers aes128-cbc,aes192-cbc,aes256-cbc,aes128-ctr,aes192-ctr,aes256-ctr,3des-cbc,arcfour128,arcfour256,arcfour,blowfish-cbc,cast128-cbcMACs hmac-md5,hmac-sha1,umac-64openssh.…

不同matlab版本所支持的gcc g+版本

问题 关于 GCC 和 G 版本问题 Matlab 2014a gcc/g 4.7.x, Matlab 2016a gcc/g 4.9.x Matlab 2017a gcc/g 4.9.x Ubuntu 15.04 gcc/g 4.9.x, Ubuntu 16.04 gcc/g 5.4.x 原则上Matlab需要和Ubuntu版本一致&#xff0c;由于CUDA 8只支持16.04,而且需要GCC 5.4.x 进行编译&#…

Linux系统中添加硬盘,并挂载到已有的目录,比如/home/user

备份用户下数据 cd home ls newuser tar cvf newuser.tar newuser  &#xff03;创建一个tar归档 rm -rf newuser mkdir newuser备注&#xff1a;newuser为home下的用户。 分区和挂载 #查看硬盘分区 fdisk -l#分区 fdisk /dev/sdbCommand (m for help):m#新建一个分区 Comman…

高性能Numpy/Scipy加速:使用Intel MKL和Intel Compilers或OpenBLAS(待续)

Numpy/Scipy加速:使用Intel MKL和Intel Compilers 1.获取Intel Parallel Studio XE Intel免费软件工具提供免费的软件包&#xff0c;其中包括完整的Intel编译器和计算库及其激活码&#xff0c;软件和激活码一一对应。注意需要使用教育邮箱注册&#xff0c;否则不予通过。 2.安装…

Linux 安装卸载软件及管理软件仓库

软件仓库 Linux的软件包都存放在一个地方&#xff0c;叫做软件仓库&#xff0c;repository。 因为Linux是在Windows之后诞生的&#xff08;1991年前后&#xff09;&#xff0c;所以为了避免Windows的这个“弊端”&#xff0c;Linux选择创建一个集中存放软件的地方。 当然了&a…

Linux 终端配置

一般Linux中的配置文件大多以点开头&#xff0c;而且多以rc结尾。比如vim的配置文件 .vimrc&#xff0c;bash shell的配置文件.bashrc&#xff0c;等等。 像这样的配置文件&#xff0c;如果用ls -l命令是列不出来的&#xff0c;需要用ls -a来列出。 “rc”&#xff0c;它是“…

Caffe2 Compilation Error gflags.cc' is being linked both statically and dynamically into this execut

问题描述 python -c from caffe2.python import core 2>/dev/null && echo "Success" || echo "Failure" 出现这个问题 ERROR: something wrong with flag flagfile in file /home/bids/softwares/gflags-2.2.0/src/gflags.cc. One possibil…

值得关注的医疗 AI 公司(待续)

医疗成像 Clearview Diagnostics 是一家开发辅助医生诊断疾病的工具的 AI 软件公司。该公司最初的重点是乳腺癌。 Butterfly Network 是一家医疗成像技术公司&#xff0c;该公司创建了一个集成了深度学习技术的便携式医疗成像设备&#xff0c;帮助缺乏医疗机构或医生不够专业的…

caffe2 介绍

Caffe2的特性 Caffe2框架可以通过一台机器上的多个GPU或具有一个及多个GPU的多台机器来进行分布式训练。 也可以在iOS系统、Android系统和树莓派&#xff08;Raspberry Pi&#xff09;上训练和部署模型。只需要运行几行代码即可调用Caffe2中预先训练好的Model Zoo模型。Caffe2…

如何向IPython Notebook中导入.py文件

相关文章链接 如何向IPython Notebook中导入.py文件 如何将 ipynb 发布到 blog 中(html, markdown格式) Introducing IPython Notebook Beginner’s IPython Notebook Tutorial Example notebook showing how to do statistics in IPython Notebook next generation sli…

Python 中的numpy 库

待总结 用scikit-learn和pandas学习线性回归 用scikit-learn和pandas学习Ridge回归 待整理的 Numpy & Pandas numpy——主要对其 N 维数组对象有用 http://www.numpy.org/ Pandas数据转为 numpy数据 df_numpyMatrix df.as_matrix() df_numpyMatrixdf.values a([3.23…

Python 中的Pandas库

待总结 用scikit-learn和pandas学习线性回归 用scikit-learn和pandas学习Ridge回归 基于python的数据分析库Pandas pandas——Python 数据分析库&#xff0c;包括数据框架&#xff08;dataframes&#xff09;等结构 http://pandas.pydata.org/ 10 Minutes to Pandas&#…

weka和matlab完成完整分类实验

本文 本文简单介绍数据集介绍、weka的使用、weka与LIBSVM、matlab与LIBSVM以及分类的若干细节问题。 1. 数据集介绍 打开网址UCI数据集&#xff0c;如下图。 从右下角可以看到Iris这个数据集&#xff0c;这是使用最多的数据集&#xff0c;目前下载量超过了82万。 打开之后跳…