FLOPs at 480x640, BN init
This commit is contained in:
parent
1038b0d269
commit
77e6bdd3c1
|
@ -55,8 +55,8 @@ def initialize_weights(model):
|
||||||
if isinstance(m, nn.Conv2d):
|
if isinstance(m, nn.Conv2d):
|
||||||
nn.init.kaiming_normal_(m.weight, mode='fan_out', nonlinearity='relu')
|
nn.init.kaiming_normal_(m.weight, mode='fan_out', nonlinearity='relu')
|
||||||
elif isinstance(m, nn.BatchNorm2d):
|
elif isinstance(m, nn.BatchNorm2d):
|
||||||
m.weight.data.fill_(1)
|
m.eps = 1e-4
|
||||||
m.bias.data.zero_()
|
m.momentum = 0.03
|
||||||
|
|
||||||
|
|
||||||
def fuse_conv_and_bn(conv, bn):
|
def fuse_conv_and_bn(conv, bn):
|
||||||
|
@ -99,7 +99,7 @@ def model_info(model, verbose=False):
|
||||||
|
|
||||||
try: # FLOPS
|
try: # FLOPS
|
||||||
from thop import profile
|
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)
|
fs = ', %.1f GFLOPS' % (macs / 1E9 * 2)
|
||||||
except:
|
except:
|
||||||
fs = ''
|
fs = ''
|
||||||
|
|
Loading…
Reference in New Issue