question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Converting fairseq NMT to transformers misses model weight

See original GitHub issue

Hi there, question about fairseq NMT model (FSMT) conversion.

I tried to convert my own fairseq-nmt model (transformer_wmt_en_de) based on this conversion script. However, decoder.embed_out weight is missing after converting fairseq model to transformers FSMT model. This parameter exists when not specifing --share-all-embeddings or --share-decoder-input-output-embed, while official fairseq wmt models do not have decoder.embed_out weight because specifying --share-all-embedding. https://github.com/pytorch/fairseq/issues/2537

Are there any solution or tips to converting own fairseq model?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
stas00commented, Feb 24, 2021

Thank you for clarifying that your original issue has been resolved. Please feel free to close this issue when you feel it’s working for you.

Based on your comments, I’m concerned about 2 things:

  1. your different dictionaries - a model has to come with the exact dict it was trained on, after conversion too. So it sounds that something isn’t right there. If you’re not sure what’s happening perhaps try to clarify how it came to be that your fairseq model has a different vocab size.
  2. perhaps that output_projection layer is getting in the way of your model if it was trained without it. You could try to hunt down the few lines where it’s used in the code and and bypass it and test whether your translation works then. If you’re comfortable editing the source code that is.
2reactions
NielsRoggecommented, Feb 22, 2021

Pinging @stas00 here

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I convert a model created with fairseq? - Beginners
Hi, I fine tuned facebook's model mbart.cc25 for machine translation with Fairseq, it saved its model as checkpoint_*.pt. How can I use it ......
Read more >
Command-line Tools — fairseq 0.12.2 documentation
Fairseq provides several command-line tools for training and evaluating models: fairseq-preprocess: Data pre-processing: build vocabularies and binarize ...
Read more >
Using Confidential Data for Domain Adaptation of Neural ...
Fine-tuning is the conventional way to apply domain adaption for NMT (Luong, Manning, et al.,. 2015; Sennrich et al., 2016b) in the scenario ......
Read more >
CTranslate2 2.0 release - Announcements - OpenNMT Forum
0 · OpenNMT/CTranslate2. New features Support conversion of Transformer models trained with Fairseq (see script ct2-fairseq-converter) Support ...
Read more >
Implementing Transformer for Language Modeling
We build the Transformer for language modeling using Fairseq and Pytorch. We train on the CMU Book Summary Dataset, evaluate the model, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found