Skip to content

Commit

Permalink
Add nn.SiLU inplace in attempt_load() (ultralytics#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 <wangliang@codingapi.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
  • Loading branch information
3 people authored Jan 15, 2021
1 parent aac18a5 commit 40b1978
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 40b1978

Please sign in to comment.