MATLAB Answers

0

Is there a way to import only learning structures from models like Alexnet and GoogLeNet?

Asked by Jin Yong Kim on 18 Jul 2019
Latest activity Commented on by Jin Yong Kim on 29 Jul 2019
Is there a way to get only the structures that are not being trained on models like Alexnet and GoogLeNet?

  0 Comments

Sign in to comment.

1 Answer

回答者: Srivardhan Gadila 2019 年 7 月 25 日
編集済み: Srivardhan Gadila 2019 年 7 月 29 日
 採用された回答

You can import the architecture of the pretrained models to MATLAB without weights for the keras, caffe and ONNX networks. You can refer to importCaffeLayers, importKerasLayers, importONNXLayers.
For the pretrained network in MATLAB we’ll get both the Layers and the trained Weights. You can remove the weights if required as follows,
net = alexnet;
layers = net.Layers;
layers(2).Weights=[];
You can also use the isprop function to check whether the property Weights or any other related trainable property exists for a layer so that you can remove them.
if isprop(layers(2),'Weights') == true
layers(2).Weights = [];
end

  3 Comments

Jin Yong Kim 2019 年 7 月 29 日
I've already tried it.
However error occurs like
Unrecognized method, property, or field 'layers' for class 'SeriesNetwork'.
I don't resolve this error
The code has been updated now to work correctly.
Jin Yong Kim 2019 年 7 月 29 日
Thank you very much!!
Now it works well.

Sign in to comment.