MATLAB Answers

CNN code exported by Deep network designer shows the Sequence unfolding layer not connected to the input

5 views (last 30 days)
A A
A A on 5 Jun 2020
Hello,
I am trying to build a CNN to regress time series data, and combine it with an LSTM. I tried this structure and just changed the final output layer :https://www.mathworks.com/help/deeplearning/ref/nnet.cnn.layer.sequenceunfoldinglayer.html
this is the code exported by Deep network designer:
lgraph = layerGraph();
tempLayers = [
sequenceInputLayer(6,"Name","input")
sequenceFoldingLayer("Name","fold")];
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
convolution2dLayer([5 5],20,"Name","conv")
batchNormalizationLayer("Name","bn")
reluLayer("Name","relu")];
lgraph = addLayers(lgraph,tempLayers);
tempLayers = [
sequenceUnfoldingLayer("Name","unfold")
flattenLayer("Name","flatten")
lstmLayer(200,"Name","lstm","OutputMode","last")
fullyConnectedLayer(10,"Name","fc")
regressionLayer("Name","regressionoutput")];
lgraph = addLayers(lgraph,tempLayers);
lgraph = connectLayers(lgraph,"fold/out","conv");
lgraph = connectLayers(lgraph,"fold/miniBatchSize","unfold/miniBatchSize");
lgraph = connectLayers(lgraph,"relu","unfold/in");
plot(lgraph);
then Matlab gave me an error :
Network: Lack of input layer.The network must have at least one input layer.
layer 'unfold': Unconnected input.Each layer input must be connected to the output of the other layer.
unconnected input was detected:
input 'in'
input 'miniBatchSize'
but the figures painted by plot(lgraph) and Deep network designer are both well connected.
Why is the structure drawing inconsistent with the exported code?How to solve this problem?

  0 Comments

Sign in to comment.

Answers (0)