Replace Input Layer to DAGNetwork

17 ビュー (過去 30 日間)
Adam Cuellar
Adam Cuellar 2020 年 6 月 18 日
コメント済み: Adam Cuellar 2020 年 6 月 19 日
Hello,
I'm trying to transfer learn from a custom model to the same model structure but with a different input size. I've tried replace just the input layer which results in an error like such:
" Unconnected input. Each layer input must be connected to the output of another layer.
Detected unconnected inputs:"
I've also tried copying the weights to a new lgraph with the correct input size and that also provided the same error. How can I change just the size of the input layer?

採用された回答

Ayush Laddha
Ayush Laddha 2020 年 6 月 19 日
From your explanation, I do infer that you wanted to replace the input layer however you witnessed some error while doing so. It would have been far better if you could have shared the custom network details and as well as the commands you used. There is already a similar query which has already been answered, you may have a look at it - https://www.mathworks.com/matlabcentral/answers/411767-trainnetwork-invalid-network
If that does not work for you, then follow the steps below to perform transfer learning on a DAG network–
  1. Import a pretrained DAG network.
  2. Extract the layer graph from the network architecture using layerGraph.
  3. Find and name the layers that you need to replace.
  4. Create the new layers to be added and name them.
  5. Connect the new layers using replaceLayers.
Please refer to the documentations of the function below –
  1 件のコメント
Adam Cuellar
Adam Cuellar 2020 年 6 月 19 日
The first link you provided helped solve the issue. Thank you!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImage Data Workflows についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by