Change input size of a pre-trained network

51 ビュー (過去 30 日間)
Virginia Fernandez Gonzalez
Virginia Fernandez Gonzalez 2019 年 4 月 25 日
編集済み: Ansuman Mahapatra 2020 年 5 月 26 日
I am working on an object detection algorithm with YOLO V2 and I have been following Mathworks guidelines. In particular, I wanted to use the solution given in the following link: After that, I'd like to re-train the network so that it gets used to the type of images I am working with. However, when it comes to modify the input size, I end up by having a graph structure, and my imported network continues to have the same input size. If I try to modify it manually, it says the InputSize property is a read-only property, and if I try to directly change my new imageInputLayer object in the network, it also says it's read only.
Is there a way to:
  • Import a pre-trained network (I am using resnet50)
  • Change its input size and number of output features
  • Re-train it?
Thank you in advance!

回答 (1 件)

HyeongHun LEE
HyeongHun LEE 2019 年 6 月 11 日
編集済み: HyeongHun LEE 2019 年 6 月 11 日
Hi there
If you want to change the specific layer parameters in pretrained neural networks(e.g. ResNet, DenseNet etc), following the procedure will work.
1. Load target pretrained network in workspace
2. Open "Neural network designer (GUI version, newly updated in 2019a)"
3. Import pretrained network model into the neural network designer space (block diagram will display automatically)
4. Change layer properties (eg. input size, filter size etc)
5. Export network model
Best regards
  3 件のコメント
Ansuman Mahapatra
Ansuman Mahapatra 2020 年 5 月 26 日
編集済み: Ansuman Mahapatra 2020 年 5 月 26 日
No it is read only. I cannot able to change even in designer app. I mean cannot edit.
But you have to delete the input layer and create a new input layer.


Community Treasure Hunt

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

Start Hunting!

Translated by