Skip to content

Commit

Permalink
Add nn.SiLU inplace in attempt_load() (#1940)
Browse files Browse the repository at this point in the history
* sleep 3 sec to load data .

* Update train.py

* Add nn.SiLU inplace in attempt_load()

Co-authored-by: wangliang <[email protected]>
Co-authored-by: Glenn Jocher <[email protected]>
  • Loading branch information
3 people authored Jan 15, 2021
1 parent 777032e commit 03ebe6e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion models/experimental.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 03ebe6e

Please sign in to comment.