Error using trainNetwork - possible change with Matlab release?
6 ビュー (過去 30 日間)
古いコメントを表示
I am attempting to run some code in R2022b which I haven't run for a while. I believe I have updated Matlab since then and I probably last ran it in 2022a. I have a new error (with no changes to the code):
Error using trainNetwork
To assign to or create a variable in a table, the number of rows must match the height of the table.
However, I am not attempting to use tables.
I am attempting to run
net = trainNetwork(XTrain,YTrain,layers,options);
where Xtrain is a 28x28x3x10000 numeric array of (small) RGB images, and YTrain is a 10000x1 numeric array of training values. The task is a regression task so I believe that both inputs can be in numeric form. Perhaps this has changed, though it's not clear from the help?
There is no other information in the error message.
回答 (1 件)
Matt J
2024 年 2 月 29 日
編集済み: Matt J
2024 年 2 月 29 日
Convert the data to cell array form.
XTrain=num2cell(Xtrain,[1,2,3]); XTrain=XTrain(:);
YTrain=num2cell(YTrain); YTrain=YTrain(:);
2 件のコメント
Matt J
2024 年 2 月 29 日
I suggest attaching the layers and options in a .mat file so that we can all examine it.
参考
カテゴリ
Help Center および File Exchange で Matrix Indexing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!