py-faster-rcnn end2end训练时 batch size只能为1?

http://caffecn.cn/?/question/509

使用end2end的方法训练py-faster-rcnn, 把 TRAIN.IMS_PER_BATCH 设置为 2的时候会出错,显示data和label的batch size不一致。如下:

1.jpg


 
在源码lib/rpn/anchor_target_layer.py中可以看到,anchor_target_layer的top[0] 的batch size被写死为1了,

2.jpg



3.jpg


 
这应该就是为什么会出现data 和 label 的batch size不一致错误的原因吧吧吧?
 但是,为什么anchor_target_layer.py里面的batch size只能是0呢? 好像官方给的experiments\cfgs\
faster_rcnn_end2end.yml 里面也是把 TRAIN.IMS_PER_BATCH设置为1 了。   是不是end2end训练的时候,TRAIN.IMS_PER_BATCH只能为1?为什么呢?? 
可以怎样修改代码使得TRAIN.IMS_PER_BATCH 为任意值吗?

======================================================================================================================================

Training with Mini-Batch size greater than 1 #267  https://github.com/rbgirshick/py-faster-rcnn/issues/267

how to change the batchsize when training the rpn model?#51  https://github.com/rbgirshick/py-faster-rcnn/issues/51

 

@rbgirshick:::::It's just not implemented. A reasonable workaround, which is already used, is to set iter_size: N in the solver, in which N is the batch size you want (currently 2 for end to end training). This may be slightly less efficient than batching, but since the inputs are spatially large operating on one image at a time isn't too bad (plus if you use more than one image there's some wasted computation where padding is introduced to fill the 4D tensor).

 

Batch size of faster rcnn #487  https://github.com/rbgirshick/py-faster-rcnn/issues/487

 

posted on   塔上的樹  阅读(3600)  评论(0编辑  收藏  举报

编辑推荐:
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
阅读排行:
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 提示词工程——AI应用必不可少的技术
· Open-Sora 2.0 重磅开源!
· 周边上新:园子的第一款马克杯温暖上架
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

点击右上角即可分享
微信分享提示