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:
Glenn Jocher 2022-07-30 21:25:16 +02:00 committed by GitHub
parent ec4de43a8a
commit 7921351b4e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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):
delattr(m, 'anchor_grid')
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'):
m.recompute_scale_factor = None # torch 1.11.0 compatibility