resnet50の出力層の除去

2 views (last 30 days)
拓 青柳
拓 青柳 on 8 Feb 2022
Commented: 拓 青柳 on 12 Feb 2022
matlab初心者です。
●コード
lgraph = layerGraph(app.classifier.netTransfer.Layers);
newlgraph = removeLayers(lgraph,{lgraph.Layers(end).Name});
App Dsignerにおいて学習済みresnet50の出力層だけ取り除いてgradcamを使用したいのですが、上記のようにするとエラーが起こります。analyzeNetworkでnewlgraphの層グラフを見てみるとDAGが無くなって1本のネットワークになってしまっているようです。どうしたら良いでしょうか。ご教授いただきたいです。

Accepted Answer

Shunichi Kusano
Shunichi Kusano on 9 Feb 2022
こんにちは。
作成されたlgraphは層の情報だけでそれらの接続の情報が抜けてしまっています。
こちらのサンプルをみていただくとわかるのですが、元のresnet50のconnection(層と層との接続情報)をいったん取り出しておいて、新しいネットワークではそれを使って全体のDagネットを復元する必要があります。
  1 Comment
拓 青柳
拓 青柳 on 12 Feb 2022
ご返信ありがとうございました。
おかげ様で解決できました!
また質問があればよろしくお願いいたしますm(_ _)m

Sign in to comment.

More Answers (0)

Products


Release

R2021a

Community Treasure Hunt

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

Start Hunting!