From a2bb42dfe96e39cd1513740236424b8ad61b5270 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Mon, 29 May 2023 02:08:45 +0200 Subject: [PATCH] Fix `Conv2()` fusing (#2885) --- ultralytics/nn/modules/conv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ultralytics/nn/modules/conv.py b/ultralytics/nn/modules/conv.py index 8feb2ee..13e970f 100644 --- a/ultralytics/nn/modules/conv.py +++ b/ultralytics/nn/modules/conv.py @@ -59,7 +59,7 @@ class Conv2(Conv): """Fuse parallel convolutions.""" w = torch.zeros_like(self.conv.weight.data) i = [x // 2 for x in w.shape[2:]] - w[:, :, i[0] - 1:i[0], i[1] - 1:i[1]] = self.cv2.weight.data.clone() + w[:, :, i[0]:i[0] + 1, i[1]:i[1] + 1] = self.cv2.weight.data.clone() self.conv.weight.data += w self.__delattr__('cv2')