Error using trainFastRCNNObjectDetector
조회 수: 3 (최근 30일)
이전 댓글 표시
Hi everybody, I tried to use trainFastRCNNObjectDetector function with custom region proposal. --> Extracting region proposals from 1064 training images...done. but I've got following errors:
Error using vision.internal.cnn.fastrcnn.RegionReader (line 146) Unable to find any region proposals to use as positive or negative training samples.
Error in vision.internal.cnn.fastrcnn.TrainingRegionDispatcher (line 63) vision.internal.cnn.fastrcnn.RegionReader(... any suggestions how to avoid this? thank you
댓글 수: 0
채택된 답변
Birju Patel
2017년 8월 28일
It's likely that your custom region proposal method is producing ROIs that are too small to process. The minimum size that we can currently process is limited by the amount of downsampling the network does prior to the last max pooling layer. (Note that we are going to remove this limitation in a future release).
By default, with alexnet the minimum size is 105x105. Knowing which network you're using for training would help determine if this is the cause of the error.
If you find that this is the cause, then you can expand small ROIs returned by your region proposal method so that they are above the minimum. Alternatively, you can resize your training images so that your objects are larger. But you would have to be careful not to make the image too large because this can increase the amount of GPU memory required to process the data. If this happens you can try to resize the image and then crop around the object.
Or you can change the network itself by reducing the output size of the final max pooling layer. For example, with alexnet you can change the last max pooling layer's pool size to 5 so that the output feature map is smaller. This changes the minimum size to 88-by-88:
net = alexnet;
layers = net.Layers;
% Reduce output size of final max pooling layer by increasing pool size to 5.
% This changes the minimum size to 88-by-88.
layers(16) = maxPooling2dLayer(5,'stride',2);
% reset fully connected layers because of the size change.
% Note: This may not be the ideal set of layers and might require some experimentation
% to figure out the best number of layers after making this change to the max pooling
% layer.
layers(17) = fullyConnectedLayer(4096);
layers(20) = fullyConnectedLayer(4096);
layers(23) = fullyConnectedLayer(2)
layers(end) = classificationLayer()
Figuring out which approach to use might require some experimentation with the layers that follow the final max pooling layer.
The other cause of this error could be that the PositiveOverlapRange and NegativeOverlapRange are set to values that make it harder to find training samples that overlap with your custom region proposals. For example, large positive overlap values could make it impossible for any of your region proposals to overlap with the ground truth.
댓글 수: 3
Ram Shtoltz
2018년 8월 1일
Hi Birju, how can I expand small ROIs returned by my region proposal method so that they are above the minimum?
AnaM
2020년 11월 4일
@Birju Patel
"If you find that this is the cause, then you can expand small ROIs returned by your region proposal method so that they are above the minimum."
How can we do this?
I already tried bigger ROIs in the training Table, downsampled my data to half and nothing...the error persists..
추가 답변 (2개)
wei zhang
2018년 12월 22일
I modified the alexnet network according to the method you provided. The first three steps of faster RCNN training were ok, and an error occurred in the fourth step.
Error using vision.internal.cnn.fastrcnn.RegionReader (line 146) Unable to find any region proposals to use as positive or negative training samples.
net = alexnet;
layers = net.Layers;
% Reduce output size of final max pooling layer by increasing pool size to 5.
% This changes the minimum size to 88-by-88.
layers(16) = maxPooling2dLayer(7,'stride',2);
layers(17) = fullyConnectedLayer(4096);
layers(20) = fullyConnectedLayer(4096);
layers(23) = fullyConnectedLayer(2)
layers(end) = classificationLayer()
PositiveOverlapRange and NegativeOverlapRange are the default
댓글 수: 0
AnaM
2020년 11월 4일
Hello!
Did you manage how to solve this issue? I am facing the same problem...
Thanks!!
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Image Data Workflows에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!