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

train.py报错ZeroDivisionError: division by zero #107

Open
wangfan002 opened this issue Feb 24, 2023 · 6 comments
Open

train.py报错ZeroDivisionError: division by zero #107

wangfan002 opened this issue Feb 24, 2023 · 6 comments

Comments

@wangfan002
Copy link

 # 记录当前epoch的平均loss与accuracy
epoch_mean_loss = total_loss / len(train_dataloader)
epoch_mean_acc = epoch_correct_num / epoch_total_num

这两个被除数是0

@HoseaHaoBupt
Copy link

我也遇到了这个问题,怎么解决

@cywjava
Copy link

cywjava commented Mar 22, 2023

是你的txt 语料 ,处理成一行一句话,文件末尾不能有换行

@Delimeng
Copy link

Delimeng commented Dec 8, 2023

不行呀,末尾也没有换行呀!!!

@Delimeng
Copy link

Delimeng commented Dec 8, 2023

是你的txt 语料 ,处理成一行一句话,文件末尾不能有换行

还是不行呀!

@Delimeng
Copy link

我也遇到了这个问题,怎么解决
你好!请问你的这个问题解决了吗?

@Delimeng
Copy link

 # 记录当前epoch的平均loss与accuracy
epoch_mean_loss = total_loss / len(train_dataloader)
epoch_mean_acc = epoch_correct_num / epoch_total_num

这两个被除数是0

你好!请问你的这个问题解决了吗?

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