trainYOLOv2ObjectDetector gives error for grayscale images with 1-channel
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Baris Kiliclar
il 17 Mar 2020
Commentato: Pedro Garcia
il 26 Mar 2021
Hello guys,
when i try to train a yolo network with input image size [3508 2480 1] and images with size [3508 2480] of class uint8, it gives the following error.
Invalid transform function defined on datastore.
The cause of the error was:
Error using vision.internal.cnn.validation.checkImageAndNetworkChannelSizes (line 8)
Invalid input image channel size: 1.
The input image channel size (1) must be the same as the network's input channel size (1).
...
When i click on the line hyperlink of first error, it shows the following code:
function checkImageAndNetworkChannelSizes(I, networkChannelSize)
% If the input image size has a different channel size than that of
% the network input size, we need to error.
[~, ~, Isize] = size(I);
if ndims(I) ~= 3 || Isize ~= networkChannelSize
error(message('vision:rcnn:invalidInputImageChannelSize', Isize, networkChannelSize));
end
I understand that images must be three dimensinal although documentary says we can use grayscale images. Is it possible to change the size of a matrix from [m n] to [m n 1] ?
Haw to fix this problem ?
Thank you,
Barış Kılıçlar
0 Commenti
Risposta accettata
Dinesh Chintaginjala
il 19 Giu 2020
Hi Baris,
I am assuming you are using MATLAB R2019b. The above error is not related to changing the matrix dimensions. This is a bug and has been fixed in R2020a version. You can upgrade to latest releases of MATLAB for all latest updates and bug fixes.
3 Commenti
anastasiia prilepskaia
il 25 Dic 2020
I tried on MATLAB R2020a as well as R2020b but still the same error for me.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Image Data Workflows in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!