How to modify the function to input multi-channel images for CNN training in MATLAB 2017a?
15 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi,
I'm trying to train a Convolutional Neural Network with the newly released functions in MATLAB 2017a.
The input consists of two gray-scale images with resolution 100*100, so I stack them as a two-channel image, thus the dimension of the image is 100*100*2.
Next, I designed the architecture of input layer as
layers = [imageInputLayer([100 100 2])
...(omit the rest)]
However, only 1 (gray-scale image) and 3 (color image) are valid for the number of channels (the third parameter in [100 100 2]).
So my settings are invalid and the error is
Error using nnet.cnn.layer.ImageInputLayer>iCheckInputSize (line 238)
Expected input image size to be a 2 or 3 element vector. For a 3-element vector, the third element
must be 3 or 1.
I will appreciate that if anybody can help to modify the built-in function, so users can input a multi-channel image, such as a 2-channel image or a 200-channel image. I've tried but got stuck.
2 Kommentare
morteza ali ahmadi
am 17 Feb. 2018
Bearbeitet: morteza ali ahmadi
am 17 Feb. 2018
I also encountered this problem. Could you find a solution?
Antworten (3)
Zhiyi TANG
am 27 Mär. 2018
Bearbeitet: Zhiyi TANG
am 27 Mär. 2018
1 Kommentar
hiba
am 6 Feb. 2019
please con you explain more the sysnatxe of using imageInputLayer with 3 dimention image size [240* 240*155 ] thank yoiu
Muhammad Nabi
am 26 Mär. 2018
I am having the same problem I have 4 2D feature images for the same label instance so my data set is [NxMx4] and I cant use a the CNN for it
2 Kommentare
Salma Ali
am 25 Mai 2018
Hi, I would like to use multi-input images with different sizes to CNN, is there any function in Matlab to do that? I appreciate any help. Thanks.
Xin Zhang
am 21 Mai 2018
Hi, i am trying to iunput 4 channels (RGB+Nir) to the RCNN. Thanks to your work, it seems that the input of 4 channels is possible using the 'imageInputLayer'. But I got another question of how to make the input argument'trainingData' of the function 'trainFasterRCNNObjectDetector'? It requires as 'Labeled ground truth images, specified as a table with two or more columns. The first column must contain paths and file names to grayscale or truecolor (RGB) images'. How can we make the argument 'trainingData' as 2 channels or 4 channels? Hope to get your reply soon. Best regards,
1 Kommentar
Siehe auch
Kategorien
Mehr zu Image Data Workflows finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!