필터 지우기
필터 지우기

Faster RCNN label problem

조회 수: 5 (최근 30일)
fortunion
fortunion 2018년 5월 10일
댓글: vishnu priya 2020년 2월 10일
Hi, I tried to train fasterRCNNObjectDetector using this tutorial: https://www.mathworks.com/help/vision/examples/object-detection-using-faster-r-cnn-deep-learning.html However after run there is a NaN value in Mini-batch Loss. I have set initial weigths and bias for convolutional layers and this problem disappeared. After detector finished training I try to detect vehicle on some test images using in training process. However there is an error:
Subscript indices must either be real positive integers or logicals.
Error in fasterRCNNObjectDetector/getScoreAssociatedWithLabel (line 637) scores = allScores(ind)';
Error in fasterRCNNObjectDetector/detect (line 515) scores = getScoreAssociatedWithLabel(this, labels, allScores);
Why this error appear?

답변 (3개)

YANGYANG LIU
YANGYANG LIU 2019년 2월 28일
편집: YANGYANG LIU 2019년 2월 28일
Wash data and label.

Tunai Marques
Tunai Marques 2019년 10월 2일
Hi,
I was able to train the tutorial example, but when I used my own images, the mini-batch loss became NaN. You mentioned that you changed the initialization weights, and so did I:
featureExtractionNetwork = resnet50;
tmp_net = featureExtractionNetwork.saveobj;
tmp_net.Layers(2,1).Weights = gpuArray(single(randn([7 7 3 64])*0.0001));
tmp_net.Layers(2,1).Bias = gpuArray(single(randn([1 1 64])*0.00001+1));
featureExtractionNetwork = featureExtractionNetwork.loadobj(tmp_net);
Still I keep getting NaN in the mini-batch loss. Any toughts on how to solve it?

Tunai Marques
Tunai Marques 2019년 10월 11일
Just a quick update: my problem was that the resized images (originally 5k x 3k pixels) turned the original bounding boxes into too small BBs. The first few convolutional layers of resnet50 (which I am using for feature extraction) were then killing all the useful data (by downsampling the already super small bounding boxes).
In order to fix the problem, I first did a somewhat smart crop on the original images (and adjusted the bouding boxes accordingly), so that the new bounding boxes in the resized images were not so small. Now it works!
Hope that helps.
  댓글 수: 1
vishnu priya
vishnu priya 2020년 2월 10일
please let me know how you did smart crop and bounding boxes

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

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

Start Hunting!

Translated by