Sequence-to-Sequence Classification Using 1-D Convolutions

1 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Sequence 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