From 3354460e55c75364f76d584e84e6f69de8af95b9 Mon Sep 17 00:00:00 2001 From: clibdev Date: Sat, 27 May 2023 19:41:14 +0300 Subject: [PATCH] torch 1.11.0 compatibility --- models/experimental.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/models/experimental.py b/models/experimental.py index 548353c..b012d4d 100644 --- a/models/experimental.py +++ b/models/experimental.py @@ -122,6 +122,8 @@ def attempt_load(weights, map_location=None): for m in model.modules(): if type(m) in [nn.Hardswish, nn.LeakyReLU, nn.ReLU, nn.ReLU6, nn.SiLU]: m.inplace = True # pytorch 1.7.0 compatibility + elif type(m) is nn.Upsample: + m.recompute_scale_factor = None # torch 1.11.0 compatibility elif type(m) is Conv: m._non_persistent_buffers_set = set() # pytorch 1.6.0 compatibility