Skip to content

[Bug]: ont-hot 编码为int 算loss报错 #5785

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task done
chenchao222 opened this issue Apr 25, 2023 · 1 comment
Closed
1 task done

[Bug]: ont-hot 编码为int 算loss报错 #5785

chenchao222 opened this issue Apr 25, 2023 · 1 comment
Assignees
Labels
bug Something isn't working triage

Comments

@chenchao222
Copy link

软件环境

- paddlepaddle:
- paddlepaddle-gpu: 2.4.2.post117
- paddlenlp: 2.5.2

重复问题

  • I have searched the existing issues

错误描述

File "D:\Python Python310lib site-packagespaddlelfluiddygraphllayers.py", line 1012, in --callreturn self.forward(*inputs, **kwargs)File "p:\Python\Python310\libsite-packages\paddlelnn layerlloss.py", line 130, in forwardout = paddle.nn.functional.binary_cross_entropy_with_logits(File "p: Python ython310lib site-packages paddle nnifunctional losspy", line 824, in binary_cross-entropy_with_logitsout = _C_ops.sigmoid_cross_entropy_with_logits(kernel with key (6PU,MCHM,int64) of kemnel 'sigmoid_cross_entropy-with_logits’is not registered and fail to fallback to CPU one.RuntimeError: (NotFound) The
[Hint: Expected kemnel_iter != iter->second.end), but received kemnel_iter == iter->second.end().] (at .. paddlephilcorelkemnel_factory.c:168)

稳定复现步骤 & 代码

pretrained_model = AutoModelForSequenceClassification.from_pretrained('ernie-health-chinese')
tokenizer = AutoTokenizer.from_pretrained('ernie-health-chinese')

criterion = paddle.nn.BCEWithLogitsLoss()
多标签 labels 做ont-hot编码为int,我改为float后可以了
在算loss时报的

@chenchao222 chenchao222 added the bug Something isn't working label Apr 25, 2023
@w5688414
Copy link
Contributor

w5688414 commented May 8, 2024

@paddle-bot paddle-bot bot closed this as completed May 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Projects
None yet
Development

No branches or pull requests

3 participants