Skip to content

Commit

Permalink
[cherry-pick] fix isnan is not supported and update pyproject (#14061)
Browse files Browse the repository at this point in the history
* 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: 张春乔 <83450930+Liyulingyue@users.noreply.github.com>
  • Loading branch information
GreatV and Liyulingyue authored Oct 22, 2024
1 parent 023d02d commit 59a54df
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions ppocr/modeling/heads/det_db_head.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 59a54df

Please sign in to comment.