Bump torch>=1.8.0 and torchvision>=0.9.0 (#11970)
This commit is contained in:
1 parent
df48c205c5
commit
1a779ee2b1
6 files changed
+12
-12
No files matched your search
@@ -87,11 +87,11 @@ def attempt_load(weights, device=None, inplace=True, fuse=True):
|
||||
|
||||
model.append(ckpt.fuse().eval() if fuse and hasattr(ckpt, 'fuse') else ckpt.eval()) # model in eval mode
|
||||
|
||||
# Module compatibility updates
|
||||
# Module updates
|
||||
for m in model.modules():
|
||||
t = type(m)
|
||||
if t in (nn.Hardswish, nn.LeakyReLU, nn.ReLU, nn.ReLU6, nn.SiLU, Detect, Model):
|
||||
m.inplace = inplace # torch 1.7.0 compatibility
|
||||
m.inplace = inplace
|
||||
if t is Detect and not isinstance(m.anchor_grid, list):
|
||||
delattr(m, 'anchor_grid')
|
||||
setattr(m, 'anchor_grid', [torch.zeros(1)] * m.nl)
|
||||
|
||||
Reference in new issue
Block a user