Skip to content
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

数据集报错 #23

Open
1125690278 opened this issue Sep 4, 2020 · 4 comments
Open

数据集报错 #23

1125690278 opened this issue Sep 4, 2020 · 4 comments

Comments

@1125690278
Copy link

用你的数据集thucnews跑多分类是OK的,用自己的数据集一直出现这个错误,请问数据集需要怎么处理吗?
Traceback (most recent call last):
File "run_fastbert.py", line 652, in
main()
File "run_fastbert.py", line 589, in main
result = evaluate(args, False, False)
File "run_fastbert.py", line 445, in evaluate
p = confusion[i,i].item()/confusion[i,:].sum().item()
ZeroDivisionError: division by zero

@hiber-niu
Copy link

我也遇到同样的问题,请问解决了吗?

@1125690278
Copy link
Author

我也遇到同样的问题,请问解决了吗?

暂时还没解决,解决了请告知一下

@BshoterJ
Copy link

试试调小些bs呢?可能是上来把所有数据训成某一类了

@Franklwl
Copy link

line 455-459:
for i in range(confusion.size()[0]):
mu = confusion[i, :].sum().item()
p = confusion[i, i].item() / mu if mu != 0. else 0
r = confusion[i, i].item() / mu if mu != 0. else 0
f1 = 2 * p * r / (p + r) if (p + r) != 0. else 0
is OK!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants