Azzera filtri
Azzera filtri

trainYOLOv​2ObjectDet​ector gives error for grayscale images with 1-channel

2 visualizzazioni (ultimi 30 giorni)
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

Risposta accettata

Dinesh Chintaginjala
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
anastasiia prilepskaia il 25 Dic 2020
I tried on MATLAB R2020a as well as R2020b but still the same error for me.

Accedi per commentare.

Più risposte (0)

Prodotti


Release

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by