Error forming mini-batch for network input
古いコメントを表示
i want to train a cnn with a folder of images with the size [h w c], the imageInputLayerargument is the same size of the images (h w c), but when training the network matlab says:
Error using trainnet (line 46)
Error forming mini-batch for network input "imageinput". Data interpreted with format "SSCB". To specify a
different format, use the InputDataFormats option.
Caused by:
Dimensions of arrays being concatenated are not consistent.
回答 (1 件)
Matt J
2026 年 3 月 2 日 3:23
1 投票
This is not enough to reproduce the error. You haven't provided input images. My guess, however, is that there are some files in C:\data that are not 570x714x3.
8 件のコメント
Walid
2026 年 3 月 2 日 9:39
Walid
2026 年 3 月 2 日 11:40
Walid
2026 年 3 月 2 日 11:43
You need,
inputSize = [570 714 1];
and
ValidationData=augimdsV,...
Walid
約22時間 前
your link goes to new code. However, your original code, as presented in your question, should be working now with the changes I propose above. If the code is working for you as well, please Accept-click the answer to indicate that the question is resolved.
As for the new code, it is pretty clear why it doesn't work. You removed the resizing done by the augmentedDatastores so, per our discussion above, it is not going to be possible to concatenate them.
Walid
約15時間 前
カテゴリ
ヘルプ センター および File Exchange で Image Data Workflows についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!