Unverified Commit 88d18d66 authored by Francisco Massa's avatar Francisco Massa Committed by GitHub
Browse files

Fix some deprecation warnings from PyTorch (#3348)

parent bda17ddf
......@@ -201,7 +201,7 @@ class RetinaNetRegressionHead(nn.Module):
losses.append(torch.nn.functional.l1_loss(
bbox_regression_per_image,
target_regression,
size_average=False
reduction='sum'
) / max(1, num_foreground))
return _sum(losses) / max(1, len(targets))
......
......@@ -23,7 +23,7 @@ def crop(clip, i, j, h, w):
def resize(clip, target_size, interpolation_mode):
assert len(target_size) == 2, "target size should be tuple (height, width)"
return torch.nn.functional.interpolate(
clip, size=target_size, mode=interpolation_mode
clip, size=target_size, mode=interpolation_mode, align_corners=False
)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment