After using custom Sigmoid layer , I am getting following error
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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?
0 Kommentare
Antworten (1)
Jayanti
am 4 Jul. 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), :) = [];
0 Kommentare
Siehe auch
Kategorien
Mehr zu Statistics and Machine Learning Toolbox finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!