Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions segmentation_models_pytorch/decoders/upernet/decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ def __init__(
)

def forward(self, x):
_, _, height, weight = x.shape
_, _, height, width = x.shape
out = [x] + [
F.interpolate(
block(x), size=(height, weight), mode="bilinear", align_corners=False
block(x), size=(height, width), mode="bilinear", align_corners=False
)
for block in self.blocks
]
Expand All @@ -62,10 +62,8 @@ def __init__(self, skip_channels, pyramid_channels, use_bathcnorm=True):
)

def forward(self, x, skip):
_, channels, height, weight = skip.shape
x = F.interpolate(
x, size=(height, weight), mode="bilinear", align_corners=False
)
_, channels, height, width = skip.shape
x = F.interpolate(x, size=(height, width), mode="bilinear", align_corners=False)
if channels != 0:
skip = self.skip_conv(skip)
x = x + skip
Expand Down