Set use_global_stats to be true in prediction when just using model json file


#1

How to set use_global_stats to be true in prediction in mxnet?
Usually, the network can be got by mx.model.load_checkpoint from model json file.


#2

Can you explain your use-case? At inference time your batch normalization should be using use_global_stats=True already and use the accumulated mean and variance.
Look at the code in batch_norm_v1-inl.h:

if (ctx.is_train && !param_.use_global_stats) {
    ...
} else {
    ...
}

#3

Usually, at inference time, I get the network as follows:
network, net_args, net_auxs = mx.model.load_checkpoint(prefix, epoch)
where the ‘prefix’ and the ‘epoch’ stand for the checkpoint model.
So, I’m confused on how the set the use_global_stats parameters used in the network.
I should have understood how to set the use_global_stat if I get the network by get_symbol.