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 <glenn.jocher@ultralytics.com>
pull/16014/head^2
Andrew 3 months ago committed by GitHub
parent 174a1e7a95
commit acec3d9c1c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      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.""" """Initialize CSP Bottleneck with a single convolution using input channels, output channels, and number."""
super().__init__() super().__init__()
c_ = int(c2 * e) # hidden channels c_ = int(c2 * e) # hidden channels
self.cv1 = Conv(c1, c2, 1, 1) self.cv1 = Conv(c1, c_, 1, 1)
self.cv2 = Conv(c1, c2, 1, 1) self.cv2 = Conv(c1, c_, 1, 1)
self.m = nn.Sequential(*[RepConv(c_, c_) for _ in range(n)]) self.m = nn.Sequential(*[RepConv(c_, c_) for _ in range(n)])
self.cv3 = Conv(c_, c2, 1, 1) if c_ != c2 else nn.Identity() self.cv3 = Conv(c_, c2, 1, 1) if c_ != c2 else nn.Identity()

Loading…
Cancel
Save