This commit is contained in:
huangtao
2022-07-27 17:55:52 +08:00
parent 7edddd1378
commit 4a15c93caf
5 changed files with 10 additions and 10 deletions

View File

@ -165,7 +165,7 @@ class Model(nn.Module):
# print('%10.3g' % (m.w.detach().sigmoid() * 2)) # shortcut weights
def fuse(self): # fuse model Conv2d() + BatchNorm2d() layers
print('Fusing layers... ')
# print('Fusing layers... ')
for m in self.model.modules():
if type(m) is Conv and hasattr(m, 'bn'):
m.conv = fuse_conv_and_bn(m.conv, m.bn) # update conv