glenn-jocher commited on
Commit
ee77632
·
unverified ·
1 Parent(s): 1832264

Revert `C3()` change (#7172)

Browse files
Files changed (1) hide show
  1. models/common.py +2 -5
models/common.py CHANGED
@@ -124,9 +124,6 @@ class BottleneckCSP(nn.Module):
124
  return self.cv4(self.act(self.bn(torch.cat((y1, y2), 1))))
125
 
126
 
127
- from models.experimental import CrossConv
128
-
129
-
130
  class C3(nn.Module):
131
  # CSP Bottleneck with 3 convolutions
132
  def __init__(self, c1, c2, n=1, shortcut=True, g=1, e=0.5): # ch_in, ch_out, number, shortcut, groups, expansion
@@ -135,8 +132,8 @@ class C3(nn.Module):
135
  self.cv1 = Conv(c1, c_, 1, 1)
136
  self.cv2 = Conv(c1, c_, 1, 1)
137
  self.cv3 = Conv(2 * c_, c2, 1) # optional act=FReLU(c2)
138
- # self.m = nn.Sequential(*(Bottleneck(c_, c_, shortcut, g, e=1.0) for _ in range(n)))
139
- self.m = nn.Sequential(*(CrossConv(c_, c_, 3, 1, g, 1.0, shortcut) for _ in range(n)))
140
 
141
  def forward(self, x):
142
  return self.cv3(torch.cat((self.m(self.cv1(x)), self.cv2(x)), 1))
 
124
  return self.cv4(self.act(self.bn(torch.cat((y1, y2), 1))))
125
 
126
 
 
 
 
127
  class C3(nn.Module):
128
  # CSP Bottleneck with 3 convolutions
129
  def __init__(self, c1, c2, n=1, shortcut=True, g=1, e=0.5): # ch_in, ch_out, number, shortcut, groups, expansion
 
132
  self.cv1 = Conv(c1, c_, 1, 1)
133
  self.cv2 = Conv(c1, c_, 1, 1)
134
  self.cv3 = Conv(2 * c_, c2, 1) # optional act=FReLU(c2)
135
+ self.m = nn.Sequential(*(Bottleneck(c_, c_, shortcut, g, e=1.0) for _ in range(n)))
136
+ # self.m = nn.Sequential(*(CrossConv(c_, c_, 3, 1, g, 1.0, shortcut) for _ in range(n)))
137
 
138
  def forward(self, x):
139
  return self.cv3(torch.cat((self.m(self.cv1(x)), self.cv2(x)), 1))