How freeze Batchnorm layer in SymbolBlock

#1

Dear all:
I am now encountering this issue: I want to freeze all the Batch Normalization layer in a gluon.SymbolBlock loaded vi ‘symbol.json’ and ‘.params’ files, i.e. I don’t want to use the local mean and var during training and use the global mean and var instead, and I don not want the global mean and var to be updated, how can I accomplish it?

Any advice will be appreciated, thank you guys!!!

#2

I’m not familiar with SymbolBlock. But if you want to use the global mean and var, you can set use_global_stats as True.

#3

Thank you bro, I know what you are talking about, but in a SymbolBlock, all computation as been transferred into graph computation, thus I can not operate on use_global_stats
Anyway, thank you for replying!!!