how to fix the warning message always displayed when I want to classify images after augmentation process, the worning message is about preallocating

1 view (last 30 days)
I have dataset of x-ray images, and I want to classify the dataset to normal and not_normal. I have used the augmentation process as shown in the following script:
augmenter = imageDataAugmenter( ...
'RandRotation',[-5 5],'RandXReflection',1,...
'RandYReflection',1,'RandXShear',[-0.05 0.05],'RandYShear',[-0.05 0.05]);
auimds = augmentedImageDatastore([224 224],imdsTrain,'DataAugmentation',augmenter);
netTransfer=trainNetwork(auimds,lgraph,options);
augtestimds=augmentedImageDatastore([224 224],imdsTest);
[predicted_labels(test_idx),posterior(test_idx,:)] = classify(netTransfer,augtestimds);
But every time there is a warning message appeare on the last statement, which is: [predicted_labels(test_idx),posterior(test_idx,:)] = classify(netTransfer,augtestimds);
The warning message said that the variable 'posterior' appears to change size on every loop iteration (within a script). consider preallocating for speed.
How can fix this issue?
Thanks in advance

Answers (0)

Categories

Find more on Get Started with Deep Learning Toolbox in Help Center and File Exchange

Products


Release

R2021b

Community Treasure Hunt

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

Start Hunting!