error in faster rcnn matlab code with the minibatch size

2 ビュー (過去 30 日間)
Sivaramakrishnan Rajaraman
Sivaramakrishnan Rajaraman 2018 年 9 月 21 日
コメント済み: Jacob Nye 2019 年 2 月 17 日
As observed from the documentation available for Object Detection Using Faster R-CNN Deep Learning, it has been mentioned that the mini-batch size must be 1 for Faster R-CNN training, which processes multiple image regions from one training image every iteration. However, when we try to execute this, we encounter the error: The minibatchsize should be atleast '4'.
optionsStage1 =
trainingOptions('sgdm', ...
'MaxEpochs', 10, ...
'MiniBatchSize', 1, ...
'InitialLearnRate', 1e-3, ...
'CheckpointPath', tempdir);
when we change the minibatchsize to '4' it works. Does that mean the Faster R-CNN processes multiple image regions from four training images every iteration? It this right?
  7 件のコメント
Fahad Parvez Mahdi
Fahad Parvez Mahdi 2018 年 12 月 25 日
I cannot say exactly the reason, but in my experience the error is coming because the number of samples are too small/the feature information they gathered are not adeqaute enough to satisfy the condition [0.7] and therefore they couldn't propose such regions. Try to reduce 'PositiveOverlapRange'and try again.
Jacob Nye
Jacob Nye 2019 年 2 月 17 日
Hi, I’ve seen this error (the one requring a minimum minibach of 4 instead of only 1) before when training faster RCNNs across different versions of MATLAB (MATLAB 2018a and MATLAB 2018b). I‘m going to guess that the reason you‘re getting this error saying the minibatch size must be at least 4 is because you‘re running the function on MATLAB 2018a or older. MATLAB changed the mandatory minibatch size between MATLAB 2018a and 2018b and the example online assumes a 2018b MATLAB version (for reference, you can find the change explained here under the “functionality being removed or changed” section of 2018b. For what its worth, in my brief experience trying to train a faster rcnn on Matlab 2018a with a minibatch size of 4, I saw much worse performance on my validation set and a more unstable training than with MATLAB 2018b and a batch size of one.

サインインしてコメントする。

回答 (2 件)

numi khnax
numi khnax 2018 年 10 月 25 日
I was trying yesterday and got the same error. I hope someone replies/address this issue.
It is actually an example shared by Matlab (https://www.mathworks.com/help/vision/examples/object-detection-using-faster-r-cnn-deep-learning.html)

ziwei li
ziwei li 2019 年 1 月 17 日
I try the same example ,and got the same error of minibatchsize. But faster-rcnn require a batchsize of 1 .
Have you find the solution? Can you share with us?Thank you!

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by