# MATLAB: I’m trying to apply the Alexnet transfer learning example but it’s not working with the dataset

I'm trying to follow the steps in this example Transfer learning using AlexNet using my set of images but it's giving me this error
    Error using trainNetwork (line 154)augmentedImageSource cannot form MiniBatches of data because input image sizes differ in 3rd dimension. Considerusing 'ColorPreprocessing' option to ensure all augmented images have same number of channels.Error in TrainAlexnet (line 42)netTransfer = trainNetwork(augimdsTrain,layers,options);Caused by:    Error using augmentedImageDatastore/applyAugmentationPipeline (line 335)    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 even resized all images to [227 227 3], same error. I also had the same problem with GoogLeNet