From c2403d785c5c215f5721446bff9b096e07d5cf84 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Sun, 11 Oct 2020 00:42:54 +0200 Subject: [PATCH] fuse() bug fix --- models/yolo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/yolo.py b/models/yolo.py index 46f1375e5..a9dc539bf 100644 --- a/models/yolo.py +++ b/models/yolo.py @@ -162,7 +162,7 @@ class Model(nn.Module): def fuse(self): # fuse model Conv2d() + BatchNorm2d() layers print('Fusing layers... ') for m in self.model.modules(): - if type(m) is Conv and hasattr(Conv, 'bn'): + if type(m) is Conv and hasattr(m, 'bn'): m._non_persistent_buffers_set = set() # pytorch 1.6.0 compatability m.conv = fuse_conv_and_bn(m.conv, m.bn) # update conv delattr(m, 'bn') # remove batchnorm