Transfer learning for 2D image using Alexnet
Mostrar comentarios más antiguos
Hello, I am trying to do as following video: https://www.mathworks.com/videos/transfer-learning-with-neural-networks-in-matlab-1492007175092.html
but my data in this case is 2D data, so the network responded some error.
Error using trainNetwork (line 154)
The training images are of size 227x227x1 but the input layer expects images of size 227x227x3.
I have tried to convert the image to 3D image in the file @readFunctionTrain but it does not work (see attached image).

I am not sure about the function @readFunctionTrain but it seems not allow me to do any change.
Have someone ever face this problem?
2 comentarios
Mohammad Sami
el 19 de Ag. de 2020
Are your images in grayscale ?
R G
el 19 de Ag. de 2020
Respuesta aceptada
Más respuestas (1)
Walter Roberson
el 19 de Ag. de 2020
0 votos
You can use a transform() of your datastore https://www.mathworks.com/help/matlab/ref/matlab.io.datastore.transform.html
Or you can use an Augmented Image Datastore, as that has an option to automatically adjust the color.
2 comentarios
R G
el 19 de Ag. de 2020
Mohammad Sami
el 22 de Ag. de 2020
The transform function was introduced in R2019a. If you are unable to upgrade, the alternative would be to set a custom ReadFcn function for your imageDatastore
Categorías
Más información sobre Deep Learning Toolbox en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
