How to train googlenet network by using Images with different size?
8 views (last 30 days)
Show older comments
I have an imageDatastore containing RGB images with different file size though I resized all the images in 224x224 resolution. when I am using 'trainNetwork' function it shows error, 'Unexpected image size: All images must have the same size.' I tried image augmentation but it shows, 'augmentedImageSource 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'. I used ColorPreprocessing option 'rgb2gray' but it makes the images dimention as 224x224x1 but googlenet is asking for 224x224x3. Any solution?
Thank you..
1 Comment
Mohammed Zubair Mohammed Shamim
on 21 Jun 2019
Option 1:
Remove all files with non "JPG" extensions from your dataset (e.g. JPEG, TIFF, PNG etc)
Option 2:
Use a batch converter (free online) to convert all non-JPG files into JPG.
I utilzed option 2.
Hope this helps.
Answers (0)
See Also
Categories
Find more on Image Data Workflows in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!