[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: 张春乔 <83450930+Liyulingyue@users.noreply.github.com>
pull/14063/head
Wang Xin 2024-10-22 10:27:45 +08:00 committed by GitHub
parent 023d02d3f3
commit 59a54df43a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 1 deletions

View File

@ -76,8 +76,12 @@ class Head(nn.Layer):
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)

View File

@ -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]