trainYOLOv2ObjectDetector gives error for grayscale images with 1-channel
조회 수: 2 (최근 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
댓글 수: 0
채택된 답변
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
2020년 12월 25일
I tried on MATLAB R2020a as well as R2020b but still the same error for me.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Image Data Workflows에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!