Training Failed - Deep Network designer

조회 수: 9 (최근 30일)
Shane Philip Abreu
Shane Philip Abreu 2021년 3월 17일
답변: Srivardhan Gadila 2021년 4월 16일
I have a training error when trying to retrain an AlexNet on my dataset. I can get the data to work when using a small amount such as 10 images but when I try to use approx 500 in each of the 2 classes it states "Training failed. Augnmented Image Datastore cannot form MiniBatches of data because input images differ in 3rd dimension. Consider using 'ColorPreprocessing option to ensure all augmented images have same number of channels"
Can anyone help please?

답변 (1개)

Srivardhan Gadila
Srivardhan Gadila 2021년 4월 16일
As the error clearly states, it seems that your data contains a mixture of grayscale and RGB images, use ColorPreprocessing Name-Value pair argument to ensure that all output images have the number of channels required by imageInputLayer of alexnet.
Refer to the description of ColorPreprocessing of AugmentedImageDatastore and Import Data into Deep Network Designer for more information.
Also make sure that all of your images have the size same as alexnet input layer which is
net = alexnet;
inputSize = net.Layers(1).InputSize
inputSize = 1×3
227 227 3
You can set OutputSize of augmentedImageDatastore to [227 227] for this.

카테고리

Help CenterFile Exchange에서 Image Data Workflows에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by