Sequence-to-Sequence Classification Using 1-D Convolutions

1 回表示 (過去 30 日間)
Parichada Trairat
Parichada Trairat 2021 年 9 月 21 日
回答済み: Katja Mogalle 2021 年 9 月 22 日
I try to adapt the model and simulation it, but it has an error when I train the model step
I don't understand about the error what does it mean?
Error using dlfeval (line 43)
Number of channels of weights (3, specified by the size of the 'C' dimension of weights) must be equal to the
size of the 'C' dimension of the input data (2).
Error in CNN_test (line 104)
[gradients, loss] = dlfeval(@modelGradients,parameters,hyperparameters,dlX,dlY,mask);

採用された回答

Katja Mogalle
Katja Mogalle 2021 年 9 月 22 日
Hi Parichada,
Just from this error and without the complete code, it's difficult to say what exactly is wrong.
I suspect that some parameters of the model were initialized to the wrong size.
You might get a better error message if you put a breakpoint on line 104 and instead of executing the call to dlfeval, you can run the following code in the command window:
yPred = model(dlX,parameters,hyperparameters,true);
yPred = softmax(yPred,'DataFormat','CBT');
dlT = dlarray(dlY,'CBT');
loss = maskedCrossEntropyLoss(yPred, dlT, numTimeSteps);
I'd expect one of these lines to error and hopefully the error better reveals where the problem is.
Thanks,
Katja

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSequence and Numeric Feature Data Workflows についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by