diff --git a/ppocr/modeling/heads/det_db_head.py b/ppocr/modeling/heads/det_db_head.py index 8f41a25b01..0f56f25fb4 100644 --- a/ppocr/modeling/heads/det_db_head.py +++ b/ppocr/modeling/heads/det_db_head.py @@ -76,8 +76,12 @@ def __init__(self, in_channels, kernel_list=[3, 2, 2], **kwargs): def forward(self, x, return_f=False): x = self.conv1(x) x = self.conv_bn1(x) + if self.training: + x = paddle.where(paddle.isnan(x), paddle.zeros_like(x), x) x = self.conv2(x) x = self.conv_bn2(x) + if self.training: + x = paddle.where(paddle.isnan(x), paddle.zeros_like(x), x) if return_f is True: f = x x = self.conv3(x) diff --git a/pyproject.toml b/pyproject.toml index 5dc7232217..cce91bfb0b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -56,7 +56,9 @@ dependencies = [ "beautifulsoup4", "fonttools>=4.24.0", "fire>=0.3.0", - "requests" + "requests", + "albumentations==1.4.10", + "albucore==0.0.13" ] [project.urls]