Getting error while running alexnet
Mostrar comentarios más antiguos
net =alexnet('Weights','none');
lys = net.Layers();
lys(end-3:end)
getting error:
Unrecognized method, property, or field 'Layers' for class 'nnet.cnn.layer.Layer'.
Respuestas (1)
Walter Roberson
el 14 de Mayo de 2023
Editada: Walter Roberson
el 14 de Mayo de 2023
0 votos
When you call alexnet() with 'Weights', 'none' then the result you get back is a Layer array, not a DagNetwork or LayerGraph. The list of layers that you are trying to get is just the same as net itself in this case.
You need the .Layers() if you load in the regular pre-trained alexnet
11 comentarios
Tan
el 14 de Mayo de 2023
Walter Roberson
el 14 de Mayo de 2023
net = alexnet('Weights','none');
lys = net;
lys(end-3:end)
and then whatever it was you were going to do with lys
Tan
el 14 de Mayo de 2023
Walter Roberson
el 14 de Mayo de 2023
I do not know whether it is correct. For one thing, you have not described to us what you are trying to do.
Tan
el 14 de Mayo de 2023
Tan
el 14 de Mayo de 2023
Editada: Walter Roberson
el 14 de Mayo de 2023
Walter Roberson
el 14 de Mayo de 2023
If I understand correctly, to do transfer learning, you have to use the trained network, not the untrained network. The untrained network has not learned anything yet, so there is nothing to transfer.
Tan
el 14 de Mayo de 2023
Walter Roberson
el 14 de Mayo de 2023
net =alexnet('Weights','none');
That asks for an untrained network. You need to work with a trained network.
mukthi
el 2 de Mayo de 2024
Even though showing error as unrecognised function or variable 'alexnet'
Walter Roberson
el 2 de Mayo de 2024
"This function requires Deep Learning Toolbox™ Model for AlexNet Network support package. If this support package is not installed, the function provides a download link. Alternatively, see Deep Learning Toolbox Model for AlexNet Network."
Categorías
Más información sobre Deep Learning Toolbox en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!