Change input size of a pre-trained network

Hi,
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: https://uk.mathworks.com/help/vision/ug/create-yolo-v2-object-detection-network.html. 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!
Virginia

Answers (1)

HyeongHun LEE
HyeongHun LEE on 11 Jun 2019
Edited: HyeongHun LEE on 11 Jun 2019
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

4 Comments

That works for other things, but the input size was a read-only property and non modifiable as per Matlab.
Well, I suffered from the same problem as your issue.
I also seen read-only property pop-up warnings when i tried to change the input size using the command window or script window from pretrained DenseNet (densenet-201).
On the other hand, importing the NN into the 'neural net designer' as above procedures, it was possible to modify,(I do not know exactly why this is possible, but I was able to modified it anyway) and after the NN export from the neural net designer, i also confirmed the input size was changed normally in a workspace.
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.
Delete existing Image Input Layer and Fully Connected Layer then add new Layer in that places . and modify the parameters.. also anyalyze the network for sucessfull creataion

Sign in to comment.

Categories

Find more on Deep Learning Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!