trainNetwork invalid network
8 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
MathWorks Support Team
le 23 Juil 2018
Modifié(e) : MathWorks Support Team
le 28 Sep 2021
Why am I getting an invalid network error from trainNetwork? It says layers are not connected and that the input layer is not first and the output layer is not last. I am resuming functionality of my network following the directions in the link below. When I visualize my layers, they are all connected properly and the first layer is the input layer and the last is the output. Why am I getting these errors?
Error using trainNetwork (line 154)
Invalid network.
Caused by:
Layer 'L1': Missing input. Each layer input must be connected to the
output of another layer.
Layer 'L3': Missing input. Each layer input must be connected to the
output of another layer.
Detected missing inputs:
input 'in2'
...
Layer 'L7': Unused output. Each layer output must be connected to the
input of another layer.
Layer 'L0': An input layer must be first in the layer array.
Layer 'Lend': An output layer must be last in the layer array.
Réponse acceptée
MathWorks Support Team
le 2 Sep 2021
Modifié(e) : MathWorks Support Team
le 28 Sep 2021
This error is due to a DAGNetwork object being inputted into the trainNetwork for the layers. The correct workflow is to use a Layer array or a LayerGraph object as input to trainNetwork:
To fix the issue, convert the DAGNetwork object into a LayerGraph object first before training:
>> newnet = trainNetwork(source, layerGraph(net),options);
The layer graph describes the architecture of a DAG network (layers and connections). Net.Layers is missing the connections causing those errors.
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Deep Learning Toolbox dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!