xlorne wangliang glenn-jocher commited on
Commit
03ebe6e
1 Parent(s): 777032e

Add nn.SiLU inplace in attempt_load() (#1940)

Browse files

* 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>

Files changed (1) hide show
  1. models/experimental.py +1 -1
models/experimental.py CHANGED
@@ -119,7 +119,7 @@ def attempt_load(weights, map_location=None):
119
 
120
  # Compatibility updates
121
  for m in model.modules():
122
- if type(m) in [nn.Hardswish, nn.LeakyReLU, nn.ReLU, nn.ReLU6]:
123
  m.inplace = True # pytorch 1.7.0 compatibility
124
  elif type(m) is Conv:
125
  m._non_persistent_buffers_set = set() # pytorch 1.6.0 compatibility
 
119
 
120
  # Compatibility updates
121
  for m in model.modules():
122
+ if type(m) in [nn.Hardswish, nn.LeakyReLU, nn.ReLU, nn.ReLU6, nn.SiLU]:
123
  m.inplace = True # pytorch 1.7.0 compatibility
124
  elif type(m) is Conv:
125
  m._non_persistent_buffers_set = set() # pytorch 1.6.0 compatibility