From acec3d9c1c74f00b4c6937c64848494be8fa802f Mon Sep 17 00:00:00 2001 From: Andrew <945984093@qq.com> Date: Mon, 25 Nov 2024 23:35:17 +0800 Subject: [PATCH] Fix `RepC3` module for RT-DETR models (#17086) Co-authored-by: Ultralytics Assistant <135830346+UltralyticsAssistant@users.noreply.github.com> Co-authored-by: Laughing <61612323+Laughing-q@users.noreply.github.com> Co-authored-by: Glenn Jocher --- ultralytics/nn/modules/block.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ultralytics/nn/modules/block.py b/ultralytics/nn/modules/block.py index 08188b6e7a..ddb21a74de 100644 --- a/ultralytics/nn/modules/block.py +++ b/ultralytics/nn/modules/block.py @@ -280,8 +280,8 @@ class RepC3(nn.Module): """Initialize CSP Bottleneck with a single convolution using input channels, output channels, and number.""" super().__init__() c_ = int(c2 * e) # hidden channels - self.cv1 = Conv(c1, c2, 1, 1) - self.cv2 = Conv(c1, c2, 1, 1) + self.cv1 = Conv(c1, c_, 1, 1) + self.cv2 = Conv(c1, c_, 1, 1) self.m = nn.Sequential(*[RepConv(c_, c_) for _ in range(n)]) self.cv3 = Conv(c_, c2, 1, 1) if c_ != c2 else nn.Identity()