Suppress torch 1.9.0 max_pool2d() warning (#4227)
This commit is contained in:
1 parent
c2c958c350
commit
18f6ba77cf
1 file changed
+4
-1
+4
-1
@@ -1,6 +1,7 @@
|
||||
# YOLOv5 common modules
|
||||
|
||||
import logging
|
||||
import warnings
|
||||
from copy import copy
|
||||
from pathlib import Path
|
||||
|
||||
@@ -158,7 +159,9 @@ class SPP(nn.Module):
|
||||
|
||||
def forward(self, x):
|
||||
x = self.cv1(x)
|
||||
return self.cv2(torch.cat([x] + [m(x) for m in self.m], 1))
|
||||
with warnings.catch_warnings():
|
||||
warnings.simplefilter('ignore') # suppress torch 1.9.0 max_pool2d() warning
|
||||
return self.cv2(torch.cat([x] + [m(x) for m in self.m], 1))
|
||||
|
||||
|
||||
class Focus(nn.Module):
|
||||
|
||||
Reference in new issue
Block a user