Unrecognized function or variable 'invertResidualLayer'
显示 更早的评论
I have installed add-on
'Deep Learning Toolbox' and 'Deep Learning Toolbox model for mobilenetv2'
and used the below code
net = mobilenetv2; % Load pretrained MobileNet model
numClasses = numel(classNames);
layers = [
net.Layers(1:end-3)
fullyConnectedLayer(numClasses,'Name','fc')
softmaxLayer('Name','softmax')
classificationLayer('Name','classoutput')];
options = trainingOptions('adam', ...
'MaxEpochs',10, ...
'MiniBatchSize',32, ...
'ValidationData',imdsValidation, ...
'ValidationFrequency',5, ...
'InitialLearnRate',1e-4, ...
'LearnRateSchedule','piecewise', ...
'LearnRateDropFactor',0.1, ...
'LearnRateDropPeriod',5, ...
'L2Regularization',0.01, ...
'Plots','training-progress');
% Train the network
net = trainNetwork(imdsTrain,layers,options);
and I got the error message below
Error using trainNetwork
invalid network.
caused by:
Layer 'block_11_add' Unconnected input. Each layer input must be connected to the output of
another layer.
Layer 'block_12_add' Unconnected input. Each layer input must be connected to the output of
another layer.
Layer 'block_14_add' Unconnected input. Each layer input must be connected to the output of
another layer.
Layer 'block_15_add' Unconnected input. Each layer input must be connected to the output of
another layer.
Layer 'block_2_add' Unconnected input. Each layer input must be connected to the output of
another layer.
Layer 'block_4_add' Unconnected input. Each layer input must be connected to the output of
another layer.
Layer 'block_5_add' Unconnected input. Each layer input must be connected to the output of
another layer.
Layer 'block_7_add' Unconnected input. Each layer input must be connected to the output of
another layer.
Layer 'block_8_add' Unconnected input. Each layer input must be connected to the output of
another layer.
Layer 'block_9_add' Unconnected input. Each layer input must be connected to the output of
another layer.
I don`t know why this error happens...
maybe using pretrained model intrigue error depends on the data?
How to solve this error?
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Deep Learning Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!