ERNIE icon indicating copy to clipboard operation
ERNIE copied to clipboard

ERNIE-GEN 运行预置的文本生成任务在评估验证集阶段报错

Open yijunL opened this issue 3 years ago • 1 comments

在AIStudio运行https://github.com/PaddlePaddle/ERNIE/tree/94a2367ba7f0f83b48330233450ea095d8dc9382/applications/tasks/text_generation 中的生成任务在验证集评估阶段报错

INFO: 09-12 18:18:23: ernie_gen_infilling_dataset_reader.py:156 * 140473676896000 set data_generator and start....... sort: 多字符标签"$\t" ERROR: 09-12 18:18:28: custom_static_generation_trainer.py:113 * 140473676896000 traceback.format_exc():Traceback (most recent call last): File "/home/aistudio/work/ERNIE/applications/tasks/text_generation/trainer/custom_static_generation_trainer.py", line 94, in do_train self.do_evaluate(self.data_set_reader.dev_reader, InstanceName.EVALUATE, steps) File "/home/aistudio/work/ERNIE/applications/tasks/text_generation/trainer/custom_static_generation_trainer.py", line 157, in do_evaluate self.model_class.get_metrics(fetch_output_dict, meta_info, phase, reader) File "/home/aistudio/work/ERNIE/applications/tasks/text_generation/model/ernie_infilling_generation.py", line 496, in get_metrics eval_res = self.eval.eval(outfile, phase, reader.features[phase]) File "../../../erniekit/metrics/gen_eval.py", line 62, in eval eval_res[mertric] = eval_func(refs, preds) File "../../../erniekit/metrics/gen_eval.py", line 75, in bleu return _compute_bleu(refs, preds, max_order=4)[0] File "../../../erniekit/metrics/gen_eval.py", line 126, in _compute_bleu ratio = float(translation_length) / reference_length ZeroDivisionError: float division by zero

yijunL avatar Sep 12 '22 10:09 yijunL

评估过程会在output文件夹中生成evaluate_step 文件,但是是空的。。 请问一下这个任务的代码应该运行在哪个版本的paddlepaddle-gpu 和paddlehub 中的呢 我的运行环境是paddlepaddle-gpu==2.3.2, paddlehub==2.3.0

yijunL avatar Sep 12 '22 10:09 yijunL

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Feel free to reopen it. Thank you for your contributions.

stale[bot] avatar Nov 12 '22 14:11 stale[bot]