-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
express_ner中,在数据预测部分出现SystemError: (Fatal) Blocking queue is killed because the data reader raises an exception #38
Comments
稍等 我们排查一下 |
好的,非常感谢,但在预测的时候,总是出现keyerror的报错, 如下是主函数部分代码:
出现的错误: 在原来的训练脚本中,则没有这样的报错,但是预测自己的数据集效果不佳 |
嗯嗯 这个问题是需要加载一个训练好的参数即可,这样就不会出现上诉的问题;出现上诉的问题报错确实代码报错风格不好,我们会优化。 我们内部讨论一下,看看是否需要加一下预测代码,后续反馈给您 |
好的,已成功,谢谢 |
单独做预测代码,报错SystemError: (Fatal) Blocking queue is killed because the data reader raises an exception.
更改的代码,在数据加载部分,更改 ExpressDataset类,变为无标签预测
变更的代码:
class ExpressDatasettest(paddle.io.Dataset):
def init(self, data_path):
self.word_vocab = load_dict('./conf/word.dic')
self.label_vocab = load_dict('./conf/tag.dic')
self.word_ids = []
self.label_ids = []
with open(data_path, 'r', encoding='utf-8') as fp:
next(fp)
for line in fp.readlines():
# words, labels = line.strip('\n').split('\t')
# words = words.split('\002')
words = line.strip("\n")
words = list(words)
sub_word_ids = convert_tokens_to_ids(words, self.word_vocab,
'OOV')
self.word_ids.append(sub_word_ids)
在预测部分出现的具体错误:
WARNING:root:DataLoader reader thread raised an exception.
Traceback (most recent call last):
File "predict.py", line 183, in
outputs, lens, decodes = model.predict(data_loader)
File "/home/yanwei/anaconda3/envs/paddlenlp36/lib/python3.6/site-packages/paddle/hapi/model.py", line 1703, in predict
logs, outputs = self._run_one_epoch(test_loader, cbks, 'predict')
File "/home/yanwei/anaconda3/envs/paddlenlp36/lib/python3.6/site-packages/paddle/hapi/model.py", line 1779, in run_one_epoch
for step, data in enumerate(data_loader):
File "/home/yanwei/anaconda3/envs/paddlenlp36/lib/python3.6/site-packages/paddle/fluid/dataloader/dataloader_iter.py", line 365, in next
return self.reader.read_next_var_list()
SystemError: (Fatal) Blocking queue is killed because the data reader raises an exception.
[Hint: Expected killed != true, but received killed:1 == true:1.] (at /paddle/paddle/fluid/operators/reader/blocking_queue.h:158)
这种情况是什么原因呀,麻烦帮忙解答一下,谢谢
The text was updated successfully, but these errors were encountered: