필터 지우기
필터 지우기

why train yolov2 detector on the same images give two differnet result when you train it in one go do and other when you train them via checkpoint?

조회 수: 2 (최근 30일)
Why when I train my detector in one go do I get better results than when I train it on the same images but the only difference is that I use checkpoint?
I use that code to create the detector:
inputLayer = imageInputLayer([128 128 3],'Name','Input','Normalization','none');
filterSize = [3 3];
middleLayers = [
convolution2dLayer(filterSize, 16, 'Padding', 1, 'name','conv_1',...
'WeightsInitializer', 'narrow-normal')
batchNormalizationLayer('Name','BN1')
reluLayer('Name','relu_1')
maxPooling2dLayer(2, 'stride',2,'Name','maxpool1')
convolution2dLayer(filterSize, 32, 'Padding', 1, 'name','conv_2',...
'WeightsInitializer', 'narrow-normal')
batchNormalizationLayer('Name','BN2')
reluLayer('Name','relu_2')
maxPooling2dLayer(2, 'stride',2,'Name','maxpool2')
convolution2dLayer(filterSize, 64, 'Padding', 1, 'name','conv_3',...
'WeightsInitializer', 'narrow-normal')
batchNormalizationLayer('Name','BN3')
reluLayer('Name','relu_3')
maxPooling2dLayer(2, 'stride',2,'Name','maxpool3')
convolution2dLayer(filterSize, 128, 'Padding', 1, 'name','conv_4',...
'WeightsInitializer', 'narrow-normal')
batchNormalizationLayer('Name','BN4')
reluLayer('Name','relu_4')
];
Igraph = layerGraph([inputLayer; middleLayers]);
numClasses = size(trainingDataTable,2)-1;
edit codeFiles\AnchorBoxes.m;
Anchors = [43 59
18 22
23 29
84 109];
Igraph = yolov2Layers([128 128 3],numClasses,Anchors,Igraph,'relu_4');
options = trainingOptions('sgdm', ...
'InitialLearnRate', 0.001, ...
'Verbose',true, 'MiniBatchSize',16,'MaxEpochs',30,...
'Shuffle','every-epoch', 'verboseFrequency',30, ...
'ExecutionEnvironment','parallel');
and when I train from checkpoint I use this code:
data = load('/checkpath/yolov2_checkpoint__216__2022_7_15__13_34_30.mat');
checkpoint = data.detector;

답변 (1개)

Birju Patel
Birju Patel 2022년 9월 8일
When you train from a checkpoint, you are resuming or continuing the training. If you continue to train the detector for more iterations on the same data, you may overfit to the training set and then do worse on your test set.
It wasn't clear if you did worse on your training set or the test set, so you should clarify that in your question.
It's also not clear whether trainingDataTable and trainingData contain the same data. Perhaps that is why you see different results?
  댓글 수: 1
Omer Ifrah
Omer Ifrah 2022년 9월 8일
The trainingDataTable and trainingData is not contain the same data.The detector that I trained from checkpoint did worse on the test set then the detector that I trained in one go do this is the problem.

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

카테고리

Help CenterFile Exchange에서 Recognition, Object Detection, and Semantic Segmentation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by