Experiment Manager Issue - Getting error when starting 2nd traiing iteration
3 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
回答(1 个)
Himanshu
2023-4-24
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.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!