trainYOLOv2ObjectDetector gives error for grayscale images with 1-channel
7 次查看(过去 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!