Skip to content
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

AttributeError: function 'bleu_zero_init' not found #19

Open
zc-work opened this issue Mar 20, 2020 · 3 comments
Open

AttributeError: function 'bleu_zero_init' not found #19

zc-work opened this issue Mar 20, 2020 · 3 comments

Comments

@zc-work
Copy link

zc-work commented Mar 20, 2020

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

@chintanckg
Copy link

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

@chintanckg
Copy link

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

Following facebookresearch/fairseq#292 fixed the problem

@zc-work
Copy link
Author

zc-work commented Jun 24, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants