Skip to content

Commit

Permalink
PyTorch 1.11.0 compatibility updates (see yolov5)
Browse files Browse the repository at this point in the history
from here: cv516Buaa#49
  • Loading branch information
mgd722 committed Dec 19, 2022
1 parent 0fd5b96 commit 51f2eb0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions models/experimental.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ def attempt_load(weights, map_location=None, inplace=True, fuse=True):
setattr(m, 'anchor_grid', [torch.zeros(1)] * m.nl)
elif type(m) is Conv:
m._non_persistent_buffers_set = set() # pytorch 1.6.0 compatibility
elif type(m) is nn.Upsample and not hasattr(m, 'recompute_scale_factor'):
m.recompute_scale_factor = None # torch 1.11.0 compatibility

if len(model) == 1:
return model[-1] # return model
Expand Down

0 comments on commit 51f2eb0

Please sign in to comment.