XSum icon indicating copy to clipboard operation
XSum copied to clipboard

AttributeError: function 'bleu_zero_init' not found

Open zc-work opened this issue 5 years ago • 3 comments

python XSum-Topic-ConvS2S/generate.py D:\NLP\XSum\XSUM-EMNLP18-topic-convs2s\topic-convs2s-emnlp18\data-topic-convs2s --path D:\NLP\XSum\XSUM-EMNLP18-topic-convs2s\topic-convs2s-emnlp18\checkpoints-topic-convs2s\checkpoint_best.pt --batch-size 1 --beam 10 --replace-unk --source-lang document --target-lang summary --doctopics doc-topics --encoder-embed-dim 512 > test-output-topic-convs2s-checkpoint-best.pt Traceback (most recent call last): File "XSum-Topic-ConvS2S/generate.py", line 164, in main(args) File "XSum-Topic-ConvS2S/generate.py", line 88, in main scorer = bleu.Scorer(dataset.dst_dict.pad(), dataset.dst_dict.eos(), dataset.dst_dict.unk()) File "D:\PycharmFile\XSum\XSum-Topic-ConvS2S\fairseq\bleu.py", line 44, in init self.reset() File "D:\PycharmFile\XSum\XSum-Topic-ConvS2S\fairseq\bleu.py", line 50, in reset C.bleu_zero_init(ctypes.byref(self.stat)) File "D:\python3.6.8\lib\ctypes_init_.py", line 361, in getattr func = self.getitem(name) File "D:\python3.6.8\lib\ctypes_init_.py", line 366, in getitem func = self._FuncPtr((name_or_ordinal, self)) AttributeError: function 'bleu_zero_init' not found

And the output file "test-output-topic-convs2s-checkpoint-best.pt":

Loading D:\NLP\XSum\XSUM-EMNLP18-topic-convs2s\topic-convs2s-emnlp18\data-topic-convs2s\dict.document-lemma.lda.txt Done! Loading D:\NLP\XSum\XSUM-EMNLP18-topic-convs2s\topic-convs2s-emnlp18\data-topic-convs2s\test.document Done! Loading D:\NLP\XSum\XSUM-EMNLP18-topic-convs2s\topic-convs2s-emnlp18\data-topic-convs2s\test.summary Done! Loading D:\NLP\XSum\XSUM-EMNLP18-topic-convs2s\topic-convs2s-emnlp18\data-topic-convs2s\test.document-lemma Done! Loading D:\NLP\XSum\XSUM-EMNLP18-topic-convs2s\topic-convs2s-emnlp18\data-topic-convs2s\test.doc-topics Done! | loading model(s) from D:\NLP\XSum\XSUM-EMNLP18-topic-convs2s\topic-convs2s-emnlp18\checkpoints-topic-convs2s\checkpoint_best.pt | [document] dictionary: 50004 types | [summary] dictionary: 50004 types | D:\NLP\XSum\XSUM-EMNLP18-topic-convs2s\topic-convs2s-emnlp18\data-topic-convs2s test 5 examples

zc-work avatar Mar 20 '20 15:03 zc-work

I am facing the same issue. Has anyone found the fix?

chintanckg avatar Jun 24 '21 07:06 chintanckg

I am facing the same issue. Has anyone found the fix?

Following https://github.com/pytorch/fairseq/issues/292 fixed the problem

chintanckg avatar Jun 24 '21 08:06 chintanckg

I am sorry I did not fix the problem. I left it and did other things.

zc-work avatar Jun 24 '21 08:06 zc-work