diff --git a/models/experimental.py b/models/experimental.py index 463e551..b8b623d 100644 --- a/models/experimental.py +++ b/models/experimental.py @@ -109,6 +109,8 @@ def attempt_load(weights, map_location=None, inplace=True, fuse=True): setattr(m, 'anchor_grid', [torch.zeros(1)] * m.nl) elif type(m) is Conv: m._non_persistent_buffers_set = set() # pytorch 1.6.0 compatibility + elif type(m) is nn.Upsample and not hasattr(m, 'recompute_scale_factor'): + m.recompute_scale_factor = None # torch 1.11.0 compatibility if len(model) == 1: return model[-1] # return model