Unverified 提交 18f6ba77 authored 作者: Glenn Jocher's avatar Glenn Jocher 提交者: GitHub

Suppress torch 1.9.0 max_pool2d() warning (#4227)

上级 c2c958c3
# YOLOv5 common modules # YOLOv5 common modules
import logging import logging
import warnings
from copy import copy from copy import copy
from pathlib import Path from pathlib import Path
...@@ -158,6 +159,8 @@ class SPP(nn.Module): ...@@ -158,6 +159,8 @@ class SPP(nn.Module):
def forward(self, x): def forward(self, x):
x = self.cv1(x) x = self.cv1(x)
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)) return self.cv2(torch.cat([x] + [m(x) for m in self.m], 1))
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论