MATLAB Answers

0

Issue with batch normalization layer of saved CNN

Kjetil Kveim さんによって質問されました 2019 年 3 月 21 日
最新アクティビティ Kjetil Kveim さんによって コメントされました 2019 年 3 月 25 日
When loading a previously trained CNN, I got an issue with the batch normalization layers. When looking into the loaded CNN model the trainable mean and variance are empty.
Name: 'batchnorm_1'
TrainedMean: []
TrainedVariance: []
So the checkpoint doesn't seem to save these parameters. Are there any workarounds for this issue? I am using Matlab R2018b.

  0 件のコメント

サインイン to comment.

製品


リリース

R2018b

1 件の回答

回答者: Vivek Singh 2019 年 3 月 22 日
 採用された回答

We were able to reproduce the issue. We will inform you once the issue is fixed.
Since TrainedMean and TrainedVariance are calculated after the training is finished, therefore as a workaround you can use the below mentioned codes to explicitly save and load the Model.
%To save model with name "demoModel", assuming your network is in "net"
save('demoModel','net')
%To load model to variable net1
net1=load('demoModel.mat','net');
net1.net.Layers(n).TrainedMean %where n is the batch normalization layer

  1 件のコメント

Perfect, thanks for the workaround :)

サインイン to comment.



Translated by