Error using trainNetwork (line 184) Number of observations in X and Y disagree.

2 ビュー (過去 30 日間)
Sharena Natasha Nor Hisham
Sharena Natasha Nor Hisham 2022 年 1 月 22 日
コメント済み: KSSV 2022 年 1 月 22 日
Please help me, I'm getting this error when I tried to train my network. Thank you. I tried the code from this Reference
Error using trainNetwork (line 184)
Number of observations in X and Y disagree.
%18. train the network
miniBatchSize = 128;
validationFrequency = floor(numel(YTrain)/miniBatchSize);
options = trainingOptions('adam', ...
'InitialLearnRate',3e-4, ...
'MaxEpochs',30, ...
'MiniBatchSize',miniBatchSize, ...
'Shuffle','every-epoch', ...
'Plots','training-progress', ...
'Verbose',false, ...
'ValidationData',{XValidation,YValidation}, ...
'ValidationFrequency',validationFrequency, ...
'LearnRateSchedule','piecewise', ...
'LearnRateDropFactor',0.1, ...
'LearnRateDropPeriod',20);
whos XTrain YTrain XValidation YValidation Xbkg
trainedNet = trainNetwork(XTrain,YTrain,layers,options);
  5 件のコメント
Sharena Natasha Nor Hisham
Sharena Natasha Nor Hisham 2022 年 1 月 22 日
oh how can I fix the dimensions?
KSSV
KSSV 2022 年 1 月 22 日
It depends on what your problem is. Regression or classification? What data you have? what you are expecting?

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

回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by