error while running graph=layerGraph(net)

조회 수: 3 (최근 30일)
Tan
Tan 2023년 5월 14일
편집: Matt J 2023년 5월 14일
graph = layerGraph(net);
Error using layerGraph
lgraph = layerGraph(net);
Invalid argument at position 1. Input must be an array of layers, a SeriesNetwork, a DAGNetwork, or a dlnetwork.
  댓글 수: 2
Matt J
Matt J 2023년 5월 14일
So what's the question? Presumably your 'net' input is none of the the legal input types listed in the error message.
Tan
Tan 2023년 5월 14일
편집: Walter Roberson 2023년 5월 14일
net = googlenet('Weights','none');
%lys = net.Layers;
%lys(end-3:end)
numClasses = numel(categories(imdsTrain.Labels));
lgraph = layerGraph(net);
after that it show
Error using layerGraph
lgraph= layerGraph(net);
Invalid argument at position 1. Input must be an array of layers, a SeriesNetwork, a DAGNetwork, or a dlnetwork.

댓글을 달려면 로그인하십시오.

답변 (1개)

Matt J
Matt J 2023년 5월 14일
Like I said, your 'net' is not one fo the types listed in the error message:
net = googlenet('Weights','none');
net =
LayerGraph with properties:
Layers: [144×1 nnet.cnn.layer.Layer]
Connections: [170×2 table]
InputNames: {'data'}
OutputNames: {'output'}
  댓글 수: 4
Tan
Tan 2023년 5월 14일
thanks a lot!
Matt J
Matt J 2023년 5월 14일
편집: Matt J 2023년 5월 14일
Why is a solution even required? You can see googlenet() is giving you a LayerGraph direcly, without the need for further manipulation.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by