From 40b1978e49889c267545871bd5e833e1cf73ea0a Mon Sep 17 00:00:00 2001 From: lorne <1991wangliang@gmail.com> Date: Sat, 16 Jan 2021 01:58:41 +0800 Subject: [PATCH] Add nn.SiLU inplace in attempt_load() (#1940) * sleep 3 sec to load data . * Update train.py * Add nn.SiLU inplace in attempt_load() Co-authored-by: wangliang Co-authored-by: Glenn Jocher --- models/experimental.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/experimental.py b/models/experimental.py index 2dbbf7fa32f2..72dc877c83cf 100644 --- a/models/experimental.py +++ b/models/experimental.py @@ -119,7 +119,7 @@ def attempt_load(weights, map_location=None): # Compatibility updates for m in model.modules(): - if type(m) in [nn.Hardswish, nn.LeakyReLU, nn.ReLU, nn.ReLU6]: + 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 Conv: m._non_persistent_buffers_set = set() # pytorch 1.6.0 compatibility