Deprecate torch 1.6.0 compat _non_persistent_buffers_set (#8797)
Deprecate torch 1.6.0 compat _non_persistent_buffers_set
This commit is contained in:
1 parent
ec4de43a8a
commit
7921351b4e
1 file changed
-2
@@ -89,8 +89,6 @@ def attempt_load(weights, device=None, inplace=True, fuse=True):
|
|||||||
if t is Detect and not isinstance(m.anchor_grid, list):
|
if t is Detect and not isinstance(m.anchor_grid, list):
|
||||||
delattr(m, 'anchor_grid')
|
delattr(m, 'anchor_grid')
|
||||||
setattr(m, 'anchor_grid', [torch.zeros(1)] * m.nl)
|
setattr(m, 'anchor_grid', [torch.zeros(1)] * m.nl)
|
||||||
elif t is Conv:
|
|
||||||
m._non_persistent_buffers_set = set() # torch 1.6.0 compatibility
|
|
||||||
elif t is nn.Upsample and not hasattr(m, 'recompute_scale_factor'):
|
elif t is nn.Upsample and not hasattr(m, 'recompute_scale_factor'):
|
||||||
m.recompute_scale_factor = None # torch 1.11.0 compatibility
|
m.recompute_scale_factor = None # torch 1.11.0 compatibility
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user