Filter löschen
Filter löschen

error in faster rcnn matlab code with the minibatch size

4 Ansichten (letzte 30 Tage)
Sivaramakrishnan Rajaraman
Sivaramakrishnan Rajaraman am 21 Sep. 2018
Kommentiert: Jacob Nye am 17 Feb. 2019
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 Kommentare
Fahad Parvez Mahdi
Fahad Parvez Mahdi am 25 Dez. 2018
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 am 17 Feb. 2019
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.

Melden Sie sich an, um zu kommentieren.

Antworten (2)

numi khnax
numi khnax am 25 Okt. 2018
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 am 17 Jan. 2019
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