In the forward method of class ClassLayer in lib/models.deeplab.py:
def forward(self, x):
x = self.layer(x)
x = self.classification(x)
pred = x.view(x.shape[0], -1)
pred = torch.sigmoid(self.fc(pred))
return x, pred
the returned x does not represent feature maps anymore because self.classification is an AdaptiveAvgPooling2D with output_size=1, and thus returns a tensor with shape BxCx1x1. Then this is resized to the size of the image later, which doesn't seem to make sense.
Shouldn't it be like this?
def forward(self, x):
x = self.layer(x)
pred = self.classification(x)
pred = pred.view(pred.shape[0], -1)
pred = torch.sigmoid(self.fc(pred))
return x, pred
In the
forward
method of classClassLayer
inlib/models.deeplab.py
:the returned
x
does not represent feature maps anymore becauseself.classification
is anAdaptiveAvgPooling2D
withoutput_size=1
, and thus returns a tensor with shape BxCx1x1. Then this is resized to the size of the image later, which doesn't seem to make sense.Shouldn't it be like this?