I tried to reimplement your approach but found that the weights of nn.batchnorm2d are not in model.parameters() so the optimizer won't update them. Also, the function updateBN() doesn't work as in "m.weight.grad.data.add_(...)" weight.grad is NoneType.
Could you share how you resolved this or I missed something? Thanks!
https://github.com/Eric-mingjie/network-slimming/blob/98e6b4d28e9909eff22ce4c45cba1b605cac9d65/main.py#L126
Hello, thank you for sharing the code.
I tried to reimplement your approach but found that the weights of nn.batchnorm2d are not in model.parameters() so the optimizer won't update them. Also, the function updateBN() doesn't work as in "m.weight.grad.data.add_(...)" weight.grad is NoneType.
Could you share how you resolved this or I missed something? Thanks!