yangjianxin1 / GPT2-chitchat

GPT2 for Chinese chitchat/用于中文闲聊的GPT2模型(实现了DialoGPT的MMI思想)
2.99k stars 680 forks source link

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

Open wangfan002 opened 1 year ago

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

这两个被除数是0

HoseaHaoBupt commented 1 year ago

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

cywjava commented 1 year ago

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

Delimeng commented 11 months ago

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

Delimeng commented 11 months ago

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

还是不行呀!

Delimeng commented 11 months ago

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

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

这两个被除数是0

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