필터 지우기
필터 지우기

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

조회 수: 3 (최근 30일)
CHRISTOPHER MILLAR
CHRISTOPHER MILLAR 2023년 4월 1일
답변: Himanshu 2023년 4월 24일
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

답변 (1개)

Himanshu
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.

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by