From 77e6bdd3c1ea410b25c407fef1df1dab98f9c27b Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Sun, 12 Apr 2020 18:44:18 -0700 Subject: [PATCH] FLOPs at 480x640, BN init --- utils/torch_utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/utils/torch_utils.py b/utils/torch_utils.py index f63bc110..9d2491f3 100644 --- a/utils/torch_utils.py +++ b/utils/torch_utils.py @@ -55,8 +55,8 @@ def initialize_weights(model): if isinstance(m, nn.Conv2d): nn.init.kaiming_normal_(m.weight, mode='fan_out', nonlinearity='relu') elif isinstance(m, nn.BatchNorm2d): - m.weight.data.fill_(1) - m.bias.data.zero_() + m.eps = 1e-4 + m.momentum = 0.03 def fuse_conv_and_bn(conv, bn): @@ -99,7 +99,7 @@ def model_info(model, verbose=False): try: # FLOPS from thop import profile - macs, _ = profile(model, inputs=(torch.zeros(1, 3, 640, 640),)) + macs, _ = profile(model, inputs=(torch.zeros(1, 3, 480, 640),)) fs = ', %.1f GFLOPS' % (macs / 1E9 * 2) except: fs = ''