Sequence-to-Sequence Classification Using 1-D Convolutions
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Parichada Trairat
il 21 Set 2021
Risposto: Katja Mogalle
il 22 Set 2021
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);
0 Commenti
Risposta accettata
Katja Mogalle
il 22 Set 2021
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 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Sequence and Numeric Feature Data Workflows in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!