After using custom Sigmoid layer , I am getting following error

6 visualizaciones (últimos 30 días)
SC P
SC P el 2 de Jul. de 2020
Respondida: Jayanti el 4 de Jul. de 2025
As I have created custom sigmoid layer and custome regression layer for multilabel classification , I have checked the layer ,it works still I am getting following error:
Error using trainNetwork (line 170)
Invalid training data. Y must be a vector,
matrix, or 4-D array of numeric responses and
must not contain NaNs.
Error in DenseNet201
(line 37)
netTransfer =
trainNetwork(augimdsTrain,lgraph,options);
Can some help me regarding this?

Respuestas (1)

Jayanti
Jayanti el 4 de Jul. de 2025
Hi,
The error you are encountering might occur when the label data (Y) passed to trainNetwork is either not in the correct format or contains invalid values such as NaN. Since you are using a custom sigmoid layer for multilabel classification, make sure your label matrix "Y" is a numeric array of size with no NaN values.
To resolve the issue, please check for and remove any NaN values in your labels using the following code:
% Remove rows with NaNs
Y(any(isnan(Y), 2), :) = [];

Categorías

Más información sobre Statistics and Machine Learning Toolbox en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by