hemingkx / CLUENER2020

A PyTorch implementation of a BiLSTM\BERT\Roberta(+CRF) model for Named Entity Recognition.
470 stars 107 forks source link

dataloder加载出错 #2

Closed zhw666888 closed 3 years ago

hemingkx commented 3 years ago

Could you paste your train log (including the error information) here?

zhw666888 commented 3 years ago

你好,bert系列模型中的data_loader文件单独运行会,报错: line 96, in collate_fn     batch_labels[j][:cur_tags_len] = labels[j] ValueError: could not broadcast input array from shape (141,) into shape (140,)

我目前对此报错不得理解,因为同样的操作,但却有10来条数据缺确实会造成这样的错误,但是总体去运行似乎并没有见到这个报错。

------------------ 原始邮件 ------------------ 发件人: "hemingkx/CLUENER2020" @.>; 发送时间: 2021年6月7日(星期一) 晚上7:41 @.>; @.**@.>; 主题: Re: [hemingkx/CLUENER2020] dataloder加载出错 (#2)

Could you paste your train log (including the error information) here?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

hemingkx commented 3 years ago

因为在整体运行时,dataloader之前需要有一步数据预处理,你参照run.py中的逻辑,每一步对比一下数据就知道了~。

zhw666888 commented 3 years ago

您好,不知道换不同的数据集,bertconfig需要为不同数量标签做些参数的改变?因为报错标签这里总是会出错。

---原始邮件--- 发件人: "Heming @.> 发送时间: 2021年6月9日(周三) 上午9:53 收件人: @.>; 抄送: @.**@.>; 主题: Re: [hemingkx/CLUENER2020] dataloder加载出错 (#2)

Closed #2.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

hemingkx commented 3 years ago

config.json里面有一个"num_labels"参数,需要设置为标签数量~。

zhw666888 commented 3 years ago

您好,这个原始文件没有这个参数,是需要自己手动设置?但是这样用您的github提供的数据,却没有报错。

------------------ 原始邮件 ------------------ 发件人: "hemingkx/CLUENER2020" @.>; 发送时间: 2021年6月9日(星期三) 晚上11:13 @.>; @.**@.>; 主题: Re: [hemingkx/CLUENER2020] dataloder加载出错 (#2)

config.json里面有一个"num_labels"参数,需要设置为标签数量~。

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

hemingkx commented 3 years ago

是在BERT-CRF/experiments/clue/config.json这个路径下,有这个参数

zhw666888 commented 3 years ago

这个文件夹应该是训练后保存模型的吧?我在开始换新数据的时候就跑不动了

---原始邮件--- 发件人: "Heming @.> 发送时间: 2021年6月10日(周四) 上午8:40 收件人: @.>; 抄送: @.**@.>; 主题: Re: [hemingkx/CLUENER2020] dataloder加载出错 (#2)

是在BERT-CRF/experiments/clue/config.json这个路径下,有这个参数

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

tianke0711 commented 3 years ago

同理 新数据就不行啦。能否提供代码测试 没有标签的test文本呢。现在都是test数据有标签的

GitHubwwZ commented 7 months ago

这个文件夹应该是训练后保存模型的吧?我在开始换新数据的时候就跑不动了 ---原始邮件--- 发件人: "Heming @.> 发送时间: 2021年6月10日(周四) 上午8:40 收件人: @.>; 抄送: @.**@.>; 主题: Re: [hemingkx/CLUENER2020] dataloder加载出错 (#2) 是在BERT-CRF/experiments/clue/config.json这个路径下,有这个参数 — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. 想问一下你的问题解决了吗?我也是换新的数据运行会报错。 RuntimeError: CUDA error: CUBLAS_STATUS_ALLOC_FAILED when calling cublasCreate(handle) 在config文件中添加“num_labels”,也是报上面这个错误。