-
Notifications
You must be signed in to change notification settings - Fork 495
AssertionError in training unsupervised MT #201
Comments
The problem is that you are not training your model to do MT here, only auto-encoding with Please check https://github.com/facebookresearch/XLM#train-on-unsupervised-mt-from-a-pretrained-model
|
@glample Thanks for your help! after adding both When replacing them with But I don't have the file I was wondering whether the parameter |
--mt_steps 'zh-en,zh-en' -> replace with --mt_steps 'zh-en,en-zh' for both directions. Back-translation (bt_steps) is an essential part of the UnsupMT algorithm so yes it is necessary. Please refer to the related papers for its impact on the quality of UnsupMT. When you say that you downloaded the data following the official instruction, I think you're mistaking the preprocessing of XNLI versus the preprocessing for UnsupervisedMT which are in two different chapters of the README. We didn't provide en-zh preprocessing scripts for UnsupervisedMT. If you're doing it, please consider adapting the files in your path to the files you're supposed to have as if you were doing "./get-data-nmt.sh --src en --tgt ro" for example. If you don't have parallel datasets and are doing UnsupMT, remove the "mt_steps". |
@aconneau Thankf for your detailed infomation. I'm sure I downloaded the data for UnsupervisedMT with |
@VictorLi2017 Sir,Have you trained the zh-en model ? What is the BLEU value? |
hello!I follow your step to train unsupervisied MT after finishing XLM pre-training,but i meet the following AssertionError: |
What is the ppl of MLM when you train the zh-en pre-training model, and is the BLEU obtained as NMT or UNMT? |
Following the instruction, I trained unsupervised MT as follow:
python train.py --exp_name unsupMT_zh-en --dump_path ./dumped/ --reload_model 'best-valid_mlm_ppl.pth,best-valid_mlm_ppl.pth' --data_path path/to/data --lgs 'zh-en' --ae_steps 'zh,en' --word_dropout 0.1 --word_blank 0.1 --word_shuffle 3 --lambda_ae '0:1,100000:0.1,300000:0' --encoder_only false --emb_dim 512 --n_layers 6 --n_heads 8 --dropout 0.1 --attention_dropout 0.1 --gelu_activation true --batch_size 32 --bptt 256 --optimizer adam_inverse_sqrt,beta1=0.9,beta2=0.98,lr=0.0001 --epoch_size 200000 --stopping_criterion 'valid_zh-en_mt_bleu,10' --validation_metrics 'valid_zh-en_mt_bleu'
when adding the parameter
--eval_bleu true
, an AssertionError is shown as following:Traceback (most recent call last): File "train.py", line 323, in <module> check_data_params(params) File "XLM/src/data/loader.py", line 320, in check_data_params assert params.eval_bleu is False or len(params.mt_steps + params.bt_steps) > 0 AssertionError
but when not adding the parameter
--eval_bleu true
, it ran successfully, until the end of epoch 0, it gave another AssertionError:WARNING - 09/16/19 15:22:29 - 0:11:28 - Metric "valid_zh-en_mt_bleu" not found in scores!
Traceback (most recent call last):
File "train.py", line 327, in
main(params)
File "train.py", line 306, in main
trainer.end_epoch(scores)
File "XLM/src/trainer.py", line 598, in end_epoch
assert metric in scores, metric
AssertionError: valid_zh-en_mt_bleu
So what's the problem? How to ran successfully with the parameter
--eval_bleu true
, and don't show the AssertionError Metric "valid_zh-en_mt_bleu" not found in scores! Thank you very much!The text was updated successfully, but these errors were encountered: