Skip to content

Commit 59a54df

Browse files
GreatVLiyulingyue
andauthored
[cherry-pick] fix isnan is not supported and update pyproject (#14061)
* fix isnan_v2 is not supported in paddle2onnx (#14060) * Update pyproject.toml for add dependency (#14058) * Update pyproject.toml * Update pyproject.toml --------- Co-authored-by: 张春乔 <[email protected]>
1 parent 023d02d commit 59a54df

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

ppocr/modeling/heads/det_db_head.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,12 @@ def __init__(self, in_channels, kernel_list=[3, 2, 2], **kwargs):
7676
def forward(self, x, return_f=False):
7777
x = self.conv1(x)
7878
x = self.conv_bn1(x)
79+
if self.training:
80+
x = paddle.where(paddle.isnan(x), paddle.zeros_like(x), x)
7981
x = self.conv2(x)
8082
x = self.conv_bn2(x)
83+
if self.training:
84+
x = paddle.where(paddle.isnan(x), paddle.zeros_like(x), x)
8185
if return_f is True:
8286
f = x
8387
x = self.conv3(x)

pyproject.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ dependencies = [
5656
"beautifulsoup4",
5757
"fonttools>=4.24.0",
5858
"fire>=0.3.0",
59-
"requests"
59+
"requests",
60+
"albumentations==1.4.10",
61+
"albucore==0.0.13"
6062
]
6163

6264
[project.urls]

0 commit comments

Comments
 (0)