Skip to content

[Question]: 如下代码,为什么这里要硬编码entitie_label == 2呢,如果关联关系里面正好没有值为2的这个关系,就会报错, 例如有4个label:{'a':1,'b':2,'c':3,'d':4},训练数据里的关系只有[(1,3),(1,4)],走到这一步时就会产生一个空集合,再往下面走就会报Floating point exception #5985

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
happybuby opened this issue May 22, 2023 · 1 comment
Assignees
Labels
question Further information is requested triage

Comments

@happybuby
Copy link

请提出你的问题

如下代码,为什么这里要硬编码entitie_label == 2呢,如果关联关系里面正好没有值为2的这个关系,就会报错,
例如有4个label:{'a':1,'b':2,'c':3,'d':4},训练数据里的关系只有[(1,3),(1,4)],走到这一步时就会产生一个空集合,再往下面走就会报Floating point exception

代码位置如下:
https://github.com/PaddlePaddle/PaddleNLP/blob/164896107fae422bb108eb48dc37dd0158aef88a/paddlenlp/transformers/layoutxlm/modeling.py#LL1163C57-L1163C57

all_possible_relations2 = all_possible_relations2[entitie_label == 2]

@happybuby happybuby added the question Further information is requested label May 22, 2023
@w5688414
Copy link
Contributor

w5688414 commented May 8, 2024

请问您的paddle和paddlenlp的环境是什么?

@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
question Further information is requested triage
Projects
None yet
Development

No branches or pull requests

4 participants