Fix `Grad strides do not match bucket view strides` warning for YOLO12 DDP training (#19395)

pull/19418/head
Laughing 2 weeks ago committed by GitHub
parent 77eac7898a
commit c15fc952e1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      ultralytics/nn/modules/block.py

@ -1227,8 +1227,8 @@ class AAttn(nn.Module):
v = v.reshape(B // self.area, N * self.area, C)
B, N, _ = x.shape
x = x.reshape(B, H, W, C).permute(0, 3, 1, 2)
v = v.reshape(B, H, W, C).permute(0, 3, 1, 2)
x = x.reshape(B, H, W, C).permute(0, 3, 1, 2).contiguous()
v = v.reshape(B, H, W, C).permute(0, 3, 1, 2).contiguous()
x = x + self.pe(v)
return self.proj(x)

Loading…
Cancel
Save