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

KeyError during inference with dialog-en model #49

Open
raviteja5 opened this issue Apr 7, 2022 · 1 comment
Open

KeyError during inference with dialog-en model #49

raviteja5 opened this issue Apr 7, 2022 · 1 comment

Comments

@raviteja5
Copy link

Hi,

Using fairseq cli, I ran the preprocessing for test files only to generate binaries, and then tried running the inference with prophetnet-dialog-en model.

Here is my code:
`
fairseq-preprocess
--user-dir prophetnet
--task translation_prophetnet
--source-lang src --target-lang tgt
--testpref tokenized_test
--destdir processed --srcdict vocab.txt --tgtdict vocab.txt
--workers 20

BEAM=5
LENPEN=1.5
CHECK_POINT=prophetnet-dialog-en.pt
TEMP_FILE=fairseq_outputs.txt
OUTPUT_FILE=sorted_outputs.txt

fairseq-generate processed --path $CHECK_POINT --user-dir prophetnet --task translation_prophetnet --batch-size 80 --gen-subset test --beam $BEAM --num-workers 4 --no-repeat-ngram-size 3 --lenpen $LENPEN 2>&1 > $TEMP_FILE
grep ^H $TEMP_FILE | cut -c 3- | sort -n | cut -f3- | sed "s/ ##//g" > $OUTPUT_FILE`

I got the following error. Would appreciate any advice on this. Thank you!

/usr/local/lib/python3.6/dist-packages/fairseq/checkpoint_utils.py in _upgrade_state_dict(state) --> 300 {"criterion_name": "CrossEntropyCriterion", "best_loss": state["best_loss"]} KeyError: 'best_loss'

@gaokaizhi
Copy link

I meet the same question, Have you solved this?

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