Faster-RCNN+VGG用自己的数据集训练模型
2016-01-20 19:54
483 查看
和ZF差不多,基本一样。不同的地方主要是网络模型的修改和训练结束后的修改。
1-6参考Faster-RCNN+ZF用自己的数据集训练模型
!!!为防止与之前的模型搞混,训练前把output文件夹删除(或改个其他名),还要把imdb\cache中的文件删除(如果有的话)
1-6参考Faster-RCNN+ZF用自己的数据集训练模型
7.模型的修改
(1)models\fast_rcnn_prototxts\vgg_16layers_fc6\train_val.prototxt
input: "bbox_targets" input_dim: 1 # to be changed on-the-fly to match num ROIs input_dim: 20 # 4*(类别数+1) (=21) input_dim: 1 input_dim: 1
input: "bbox_loss_weights" input_dim: 1 # to be changed on-the-fly to match num ROIs input_dim: 20 # 4*(类别数+1) input_dim: 1 input_dim: 1
layer { bottom: "fc7" top: "cls_score" name: "cls_score" param { lr_mult: 1.0 } param { lr_mult: 2.0 } type: "InnerProduct" inner_product_param { num_output: 5 #类别数+1 weight_filler { type: "gaussian" std: 0.01 } bias_filler { type: "constant" value: 0 } } }
layer { bottom: "fc7" top: "bbox_pred" name: "bbox_pred" type: "InnerProduct" param { lr_mult: 1.0 } param { lr_mult: 2.0 } inner_product_param { num_output: 20 #4*(类别数+1) weight_filler { type: "gaussian" std: 0.001 } bias_filler { type: "constant" value: 0 } } }
(2)models\fast_rcnn_prototxts\vgg_16layers_fc6\test.prototxt
layer { bottom: "fc7" top: "cls_score" name: "cls_score" param { lr_mult: 1.0 } param { lr_mult: 2.0 } type: "InnerProduct" inner_product_param { num_output: 5 #类别数+1 weight_filler { type: "gaussian" std: 0.01 } bias_filler { type: "constant" value: 0 } } }
layer { bottom: "fc7" top: "bbox_pred" name: "bbox_pred" type: "InnerProduct" param { lr_mult: 1.0 } param { lr_mult: 2.0 } inner_product_param { num_output: 20 #4*(类别数+1) weight_filler { type: "gaussian" std: 0.001 } bias_filler { type: "constant" value: 0 } } }
(3)models\fast_rcnn_prototxts\vgg_16layers_conv3_1\train_val.prototxt
input: "bbox_targets" input_dim: 1 # to be changed on-the-fly to match num ROIs input_dim: 20 # 4*(类别数+1) input_dim: 1 input_dim: 1
input: "bbox_loss_weights" input_dim: 1 # to be changed on-the-fly to match num ROIs input_dim: 20 # 4* (类别数+1) input_dim: 1 input_dim: 1
layer { bottom: "fc7" top: "cls_score" name: "cls_score" param { lr_mult: 1.0 } param { lr_mult: 2.0 } type: "InnerProduct" inner_product_param { num_output: 5 #类别数+1 weight_filler { type: "gaussian" std: 0.01 } bias_filler { type: "constant" value: 0 } } }
layer { bottom: "fc7" top: "bbox_pred" name: "bbox_pred" type: "InnerProduct" param { lr_mult: 1.0 } param { lr_mult: 2.0 } inner_product_param { num_output: 20 #4*(类别数+1) weight_filler { type: "gaussian" std: 0.001 } bias_filler { type: "constant" value: 0 } } }
(4)models\fast_rcnn_prototxts\vgg_16layers_conv3_1\test.prototxt
layer { bottom: "fc7" top: "cls_score" name: "cls_score" param { lr_mult: 1.0 } param { lr_mult: 2.0 } type: "InnerProduct" inner_product_param { num_output:5 #类别数+1 weight_filler { type: "gaussian" std: 0.01 } bias_filler { type: "constant" value: 0 } } }
layer { bottom: "fc7" top: "bbox_pred" name: "bbox_pred" type: "InnerProduct" param { lr_mult: 1.0 } param { lr_mult: 2.0 } inner_product_param { num_output: 20 #4*(类别数+1) weight_filler { type: "gaussian" std: 0.001 } bias_filler { type: "constant" value: 0 } } }
!!!为防止与之前的模型搞混,训练前把output文件夹删除(或改个其他名),还要把imdb\cache中的文件删除(如果有的话)
8.开始训练
experiments\script_faster_rcnn_VOC2007_VGG16.m
9.训练完后
将relu5(包括relu5)前的层删除,并将roi_pool5的bottom改为data和rois。并且前面的input_dim:分别改为1,512,50,50,具体如下:input: "data" input_dim: 1 input_dim: 512 input_dim: 50 input_dim: 50
layer { bottom: "data" bottom: "rois" top: "pool5" name: "roi_pool5" type: "ROIPooling" roi_pooling_param { pooled_w: 7 pooled_h: 7 spatial_scale: 0.0625 # (1/16) } }
相关文章推荐
- 图解SSL/TLS协议
- 博客如何使用百度打赏组件?
- 计算机视觉中常用数据集
- 实现二级列表(实现QQ的好友列表)
- vmware tools的复制粘贴失效
- 01 WAMPServer集成环境和安装
- 模板类与类模板、函数模板与模板函数等的区别
- ldp hello报文接收的处理流程
- 运算符的优先级&同优先级内的结合性&序列点
- opencv拟合抛物线
- 程序设计实践-阅读笔记(二)
- Java--多线程读取网络图片并保存在本地
- 拖动效果程序
- java运用Comparator为对象排序
- MySQL参数
- ViewPager实现图片轮转
- C语言开发函数库时对外接口隐藏库内结构体实现细节的方法
- plsql link oracle
- 【NYOJ】[39]水仙花数
- LeetCode Set Matrix Zeroes