Sequence-to-Sequence Classification Using 1-D Convolutions

1 visualización (últimos 30 días)
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);

Respuesta aceptada

Katja Mogalle
Katja Mogalle el 22 de Sept. de 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

Más respuestas (0)

Categorías

Más información sobre Sequence and Numeric Feature Data Workflows en Help Center y File Exchange.

Productos


Versión

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by