Error using dlfeval when custom training

9 visualizaciones (últimos 30 días)
DL
DL el 25 de Abr. de 2021
Respondida: DL el 29 de Abr. de 2021
Hi, when I was doing custom training for the model there was an error of
Error using dlfeval (line 43)
One input argument can have dimension labels only when the other input argument is an unformatted scalar. Use .* for element-wise multiplication.
Error in test_Tranformer (line 81)
[loss,gradients] = dlfeval(@modelGradients, Training_X_1, Training_Y_1, parameters);
Did someone have similar error before and what should I do to fix it?

Respuestas (1)

DL
DL el 29 de Abr. de 2021
The potential answer could be, do not specific the dimension labels when you do minibatch. Concretely,
mbqTrain = minibatchqueue(cdsTrain,2,...
'MiniBatchSize',minibatch_size,...
'MiniBatchFcn',@preprocessMiniBatch,...
'MiniBatchFormat',{'',''},... % do not specific the dimensional labels or set it carefully
"PartialMiniBatch","discard");
You may get another error by mse function when you cauculate the loss, and if you specific the dimensional labels, say mse(Y, X, "DataFormat", "SSB"), it would be good to go if no addtional errors.

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