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.
John Michell answered .
2025-11-20
%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