- 转换DAGNetwork对象LayerGraph对象
- 代替过去的几层
- 初始层冻结偏见/重量(可选)
- 贯通所有层的原始顺序通过使用支持功能万博1manbetxcreateLgraphUsingConnections
学习使用resnet101传输中的错误
51视图(30天)
显示旧的评论
我想学习使用resnet101转移。
当我建立网络和使用trainNetwork函数如下所示,我得到以下错误。原因是什么?
层“res2a”:无关的输入。每一层的输入必须加上另一层的输出。
发现一个无关的输入:
网= resnet101;
层= net.Layers;
层= [
层(1:344)
fullyConnectedLayer (Numberofclasses)
层(346)
classificationLayer];
选择= trainingOptions (“个”,…
“MiniBatchSize”,16岁,…
“InitialLearnRate”,0.0001,…
…)
trainNetwork (TrainImage、TrainData层,选择);
0评论
接受的答案
彰Agata
2021年3月18日
MATLAB代码将是这样。
网= resnet101;
% 1。DAGNetwork对象转换为LayerGraph对象
lgraph = layerGraph(净);
% 2。代替过去的几层
lgraph = replaceLayer (lgraph,“fc1000”,…
fullyConnectedLayer (Numberofclasses“名字”,“fcNew”));
lgraph = replaceLayer (lgraph,“ClassificationLayer_predictions”,…
classificationLayer (“名字”,“ClassificationNew”));
% 4。贯通所有层的原始订单
通过使用支持函数createL万博1manbetxgraphUsingConnections %
层= lgraph.Layers;
连接= lgraph.Connections;
lgraph = createLgraphUsingConnections(层,连接);
%训练网络
选择= trainingOptions (“个”,…
“MiniBatchSize”,16岁,…
“InitialLearnRate”,0.0001,…
…)
网= trainNetwork (imdsTrain、lgraph选项);
3评论
棕褐色
2023年5月14日17
嗨,尽管使用命令
层= lgraph.Layers;
连接= lgraph.Connections;
lgraph = createLgraphUsingConnections(层,连接);
它也显示了同样的错误:
trainedNet = trainNetwork (augmentedTrainingSet、lgraph选项);
错误使用trainNetwork
无效的网络。
引起的:
层“inception_3a-output”:无关的输入。每一层的输入必须连接到另一个的输出
层。
层“inception_3b-output”:无关的输入。每一层的输入必须连接到另一个的输出
层。
层“inception_4a-output”:无关的输入。每一层的输入必须连接到另一个的输出
层。
层“inception_4b-output”:无关的输入。每一层的输入必须连接到另一个的输出
层。
层“inception_4c-output”:无关的输入。每一层的输入必须连接到另一个的输出
层。
层“inception_4d-output”:无关的输入。每一层的输入必须连接到另一个的输出
层。
层“inception_4e-output”:无关的输入。每一层的输入必须连接到另一个的输出
层。
层“inception_5a-output”:无关的输入。每一层的输入必须连接到另一个的输出
层。
层“inception_5b-output”:无关的输入。每一层的输入必须连接到另一个的输出
层。