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

9 ビュー (過去 30 日間)
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

採用された回答

Dinesh Chintaginjala
Dinesh Chintaginjala 2020 年 6 月 19 日
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 件のコメント
anastasiia prilepskaia
anastasiia prilepskaia 2020 年 12 月 25 日
I tried on MATLAB R2020a as well as R2020b but still the same error for me.
Pedro Garcia
Pedro Garcia 2021 年 3 月 26 日
same

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImage Data Workflows についてさらに検索

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by