MATLAB Answers

Checkpoint not working with batch normalization

40 views (last 30 days)
Alec Digirolamo
Alec Digirolamo on 8 Jul 2020
Answered: Mahesh Taparia on 13 Jul 2020
I am using the Deep Learning Toolbox to build and train a convolutional network. In my network I have batch normalization layers after my convolutional layers. I attempted to save my progress using the CheckpointPath option, but when I loaded my network from a checkpoint via load('checkpoint_name.mat'), using predict(net, XValidation) gave the following error:
"Error using DAGNetwork/calculatePredict>predictBatch (line 157)
Input network must not have batch normalization layers with empty
Mean or Variance properties. To calculate the batch normalization
statistics, use the trainNetwork function.
Error in DAGNetwork/calculatePredict (line 17)
Y = predictBatch( ...
Error in DAGNetwork/predict (line 131)
Y = this.calculatePredict( ...
Error in SeriesNetwork/predict (line 263)
Y = this.UnderlyingDAGNetwork.predict(X, varargin{:});
Error in TestNetworks (line 7)
YPredicted = predict(net, XValidation);"
Does someone know what causes this and/or how to fix it?
Thanks in advance.

  0 Comments

Sign in to comment.

Answers (1)

Mahesh Taparia
Mahesh Taparia on 13 Jul 2020
Hi
The possible workaround of this problem is to save the weights of the network or the complete workspace after completion of training using save function. While making the inference, load that back to the workspace. Hope it will help!

  0 Comments

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!

Translated by