Filter löschen
Filter löschen

Image Classification Training Issue

16 Ansichten (letzte 30 Tage)
Divya
Divya am 12 Jul. 2024 um 6:28
Kommentiert: Divit am 12 Jul. 2024 um 14:50
The following error comes while executing the image classification task.
augementedImageDatastore cannot form minibatches of data because the input image sizes differ in the 3rd dimension.Consider using color preprocessing to ensure all augmented images have same no of channels.

Antworten (1)

Divit
Divit am 12 Jul. 2024 um 6:52
Hi Divya,
The error you're encountering indicates that the images in your dataset have different numbers of channels. For example, some images might be grayscale (single channel) while others are RGB (three channels). 'augmentedImageDatastore' expects all images to have the same number of channels.
To resolve this issue, you can preprocess your images using a custom function to ensure they all have the same number of channels.
Alternatively, you can use the 'ColorPreprocessing' property of 'augmentedImageDatastore'. You can learn more about the 'ColorPreprocessing' property by going through the following documentation link:
  2 Kommentare
Divya
Divya am 12 Jul. 2024 um 6:59
I had applied this command to create the augmented data store but not sure how to save the images in a new folder
Divit
Divit am 12 Jul. 2024 um 14:50
Hi,
You can use the 'imwrite' function to save the images after you have completed the preprocessing.
To learn more about 'imwrite', you can refer to the following documentation link: https://www.mathworks.com/help/matlab/ref/imwrite.html

Melden Sie sich an, um zu kommentieren.

Produkte


Version

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by