GAN Training: Error with augmented image datastore

26 次查看(过去 30 天)
Hi, I had this script running with one dataabse, however the generated images were far too pixelated, so I decided to switch the database to another(and nothing else) and now I'm getting the below error. I'm new to this, could I please have some help debugging it?
Error using augmentedImageDatastore/applyAugmentationPipeline (line 391)
augmentedImageDatastore cannot form MiniBatches of data because input image sizes differ in 3rd
dimension. Consider using 'ColorPreprocessing' option to ensure all augmented images have same
number of channels.
Error in augmentedImageDatastore>@(c)self.applyAugmentationPipeline(c) (line 372)
Xout = cellfun(@(c) self.applyAugmentationPipeline(c),X,'UniformOutput',false);
Error in augmentedImageDatastore/applyAugmentationPipelineToBatch (line 372)
Xout = cellfun(@(c) self.applyAugmentationPipeline(c),X,'UniformOutput',false);
Error in augmentedImageDatastore/read (line 308)
input = self.applyAugmentationPipelineToBatch(input);
Error in GANUTKFace (line 168)
data = read(augimds);

采纳的回答

Walter Roberson
Walter Roberson 2020-8-2
编辑:Walter Roberson 2020-8-3
You presently have a mix of rgb and grayscale images and need to be consistent; the option can automatically convert
  2 个评论
Nabiilah
Nabiilah 2020-8-3
Thank you for clarifying that, where in the script would I specify this option please?
Nabiilah
Nabiilah 2020-8-3
编辑:Nabiilah 2020-8-3
I got it to work by adding the ColorReprocessing option to the below:
%Augment the data to include random horizontal flipping and to resize the image to 64x64
augmenter = imageDataAugmenter('RandXReflection', true);
augimds = augmentedImageDatastore([64 64], imds,'ColorPreprocessing', 'gray2rgb', 'DataAugmentation', augmenter);
Thank you :)

请先登录,再进行评论。

更多回答(0 个)

类别

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