Feature Input layer error MATLAB 2021a

I am running the below code on MATLAB 2021a in Ubuntu 20.04.
numFeatures = 21;
numClasses = 3;
layers = [
featureInputLayer(numFeatures,'Name','input')
fullyConnectedLayer(numClasses, 'Name','fc')
softmaxLayer('Name','sm')
classificationLayer('Name','classification')]
I am not sure why I am getting the below error
Unable to resolve the name nnet.internal.cnn.layer.FeatureInput.
Error in featureInputLayer (line 99)
internalLayer = nnet.internal.cnn.layer.FeatureInput(...
It was working fine in MATLAB2020b. Any help is greatly appreciated.

Réponses (1)

Chunru
Chunru le 23 Oct 2021
Modifié(e) : Chunru le 23 Oct 2021
featureInputLayer is Introduced in R2020b.
Try:
which featureInputLayer
/MATLAB/toolbox/nnet/cnn/featureInputLayer.m
numFeatures = 21;
numClasses = 3;
layers = [
featureInputLayer(numFeatures,'Name','input')
fullyConnectedLayer(numClasses, 'Name','fc')
softmaxLayer('Name','sm')
classificationLayer('Name','classification')]
layers =
4×1 Layer array with layers: 1 'input' Feature Input 21 features 2 'fc' Fully Connected 3 fully connected layer 3 'sm' Softmax softmax 4 'classification' Classification Output crossentropyex

4 commentaires

Dushyant Sahoo
Dushyant Sahoo le 23 Oct 2021
Running the command which featureInputLayer, I get below as an output
/usr/local/MATLAB/R2021a/toolbox/nnet/cnn/featureInputLayer.m
But when I run the next set of functions, I am getting below error
Unable to resolve the name nnet.internal.cnn.layer.FeatureInput.
Error in featureInputLayer (line 99)
internalLayer = nnet.internal.cnn.layer.FeatureInput(...
Chunru
Chunru le 23 Oct 2021
Open up the "/MATLAB/toolbox/nnet/cnn/featureInputLayer.m" and set a break pointer. Then run the command again.
Dushyant Sahoo
Dushyant Sahoo le 23 Oct 2021
Modifié(e) : Dushyant Sahoo le 23 Oct 2021
How does that help? There seems to be a problem in inbuilt function "featureInputLayer" which is a read only file. I am not sure how to correct the problem. Everything appears to work in MATLAB2020b but not in 2021a.
Chunru
Chunru le 23 Oct 2021
Running inside the .m file allows you to step through the program and locate where things go wrong. Without your machine, that is the most we can suggest. Next thing you can try is to reinstall matlab.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Deep Learning Toolbox dans Centre d'aide et File Exchange

Produits

Version

R2021a

Commenté :

le 23 Oct 2021

Community Treasure Hunt

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

Start Hunting!

Translated by