Skip to content

Commit c8e500a

Browse files
committed
fix torchfix errors x2
1 parent 3124951 commit c8e500a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

segmentation_models_pytorch/decoders/deeplabv3/decoder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def __init__(
105105
)
106106

107107
scale_factor = 4 if output_stride == 16 and encoder_depth > 3 else 2
108-
self.up = nn.UpsamplingBilinear2d(scale_factor=scale_factor)
108+
self.up = nn.Upsample(mode="bilinear", scale_factor=scale_factor)
109109

110110
highres_in_channels = encoder_channels[2]
111111
highres_out_channels = 48 # proposed by authors of paper

segmentation_models_pytorch/losses/_functional.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ def wing_loss(
226226
idx_smaller = diff_abs < width
227227
idx_bigger = diff_abs >= width
228228

229-
loss[idx_smaller] = width * torch.log(1 + diff_abs[idx_smaller] / curvature)
229+
loss[idx_smaller] = width * torch.log1p(diff_abs[idx_smaller] / curvature)
230230

231231
C = width - width * math.log(1 + width / curvature)
232232
loss[idx_bigger] = loss[idx_bigger] - C

0 commit comments

Comments
 (0)