mirror of
https://github.com/ultralytics/yolov5.git
synced 2025-06-03 14:49:29 +08:00
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 <wangliang@codingapi.com> Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
parent
777032efbc
commit
03ebe6ea14
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user