Experiment Manager Issue - Getting error when starting 2nd traiing iteration

3 Ansichten (letzte 30 Tage)
I have setup an experiment script through Experiment Manager.
The script runs the 1st training session but then it fails the setup function validation on the 2nd run of the script
Error(s) occurred while validating the setup function: Caused by: Unable to determine if experiment is for classification or regression because setup function returned invalid outputs.
Invalid network. Layer 'fold': Unconnected output. Each layer output must be connected to the input of another layer.
Layer 'unfold': Unconnected input. Each layer input must be connected to the output of another layer.
I use a very basci network structure:
layers = [
sequenceInputLayer(inputSize,'Name','input','Normalization','zscore')
sequenceFoldingLayer('Name','fold')
convolution2dLayer(filterSize,numFilters,'Name','conv1')
batchNormalizationLayer('Name','bn1')
reluLayer('Name','relu1')
dropoutLayer(0.5,'Name','DP')
sequenceUnfoldingLayer('Name','unfold')
flattenLayer('Name','flatten')
bilstmLayer(numHiddenUnits,'OutputMode','last','Name','lstm')
fullyConnectedLayer(numClasses, 'Name','fc')
softmaxLayer('Name','softmax')
classificationLayer('Name','classification')];
lgraph = layerGraph(layers);
lgraph = connectLayers(lgraph,'fold/miniBatchSize','unfold/miniBatchSize');
Any ideas as to where I am going wrong? I dont understand how it can be connected properly for the 1st run through of the script but then fail when validating the setup on the next iteration
Thanks
Chris

Antworten (1)

Himanshu
Himanshu am 24 Apr. 2023
Hello Christopher,
As per my understanding, you are facing an error while running the provided network structure script. The "unconnected output" and "unconnected input" errors occurred due to the connections between the layers.
You can ensure that the layers are connected properly in the layer graph by using the following code:
lgraph = layerGraph(layers);
lgraph = connectLayers(lgraph, 'input', 'fold');
lgraph = connectLayers(lgraph, 'fold', 'conv1');
lgraph = connectLayers(lgraph, 'DP', 'unfold');
lgraph = connectLayers(lgraph, 'unfold', 'flatten');
lgraph = connectLayers(lgraph, 'flatten', 'lstm');
lgraph = connectLayers(lgraph, 'lstm', 'fc');
The issue with the script failing on the second run might be due to not properly resetting variables between runs. To fix this, ensure that you reset or reinitialize any affected variables or states before starting a new run.
You can refer to the below documentation to learn more about "connectLayers" function in MATLAB.

Kategorien

Mehr zu Get Started with MATLAB finden Sie in Help Center und File Exchange

Produkte


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by