MATLAB: How can i make alexnet accept 277x277x1 images

alexnetdeep learningDeep Learning Toolbox

i got error in example TransferLearningUsingAlexNetExample Error using trainNetwork (line 140) The training images are of size 227x227x1 but the input layer expects images of size 227x227x3. my dataset 277X277x1

Best Answer

You can resize an image with the imresize function. Now since your images are of size 277x277x1 I will assume they are grayscale, but AlexNet was trained with RGB values and are thus 227x227x 3. It is not possible for you to recover color information from a grayscale image. You may be required to retrain the entire network with grayscale images.
I suggest for more questions on getting started with Deep Learning you check out the FREE Deep Learning OnRamp: https://matlabacademy.mathworks.com/
Related Question