Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Unable to train Supervised MT on En-De translation #79

Closed
sugeeth14 opened this issue May 14, 2019 · 6 comments
Closed

Unable to train Supervised MT on En-De translation #79

sugeeth14 opened this issue May 14, 2019 · 6 comments

Comments

@sugeeth14
Copy link

Hi ,
Firstly thanks for the release I wanted to try the En-De MT task using language model. So the following is the command I used for training the language model
python train.py --exp_name test_ende_mlm --dump_path ./dumped/ --data_path ./data/processed/en-de/ --lgs 'en-de' --clm_steps '' --mlm_steps 'en,de' --emb_dim 512 --n_layers 6 --n_heads 8 --dropout 0.1 --attention_dropout 0.1 --gelu_activation true --bptt 250 --batch_size 32 --optimizer adam,lr=0.0001 --epoch_size 200000 --validation_metrics _valid_mlm_ppl --stopping_criterion _valid_mlm_ppl,10

Next as suggested by you here I tokenized applied bpe and binarized the parallel data files.

Then to train the supervised MT from pretrained model I used the following command

python train.py --exp_name super_mt_en_de --dump_path ./dumped/ --reload_model 'dumped/test_ende_mlm/3rn075dpy4/best-valid_mlm_ppl.pth,dumped/test_ende_mlm/3rn075dpy4/best-valid_mlm_ppl.pth' --data_path ./data/processed/en-de/ --lgs 'en-de' --mt_steps "en-de" --encoder_only false --emb_dim 512 --n_layers 6 --n_heads 8 --dropout 0.1 --attention_dropout 0.1 --tokens_per_batch 4096 --bptt 250 --batch_size 32 --optimizer adam_inverse_sqrt,beta1=0.9,beta2=0.98,lr=0.0007 --epoch_size -1 --eval_bleu true --stopping_criterion 'valid_en-de_mt_bleu,10' --validation_metrics 'valid_en-de_mt_bleu' --gelu_activation true

But I get the following error

Traceback (most recent call last):
     File "train.py", line 326, in <module>
        check_data_params(params)
    File "Sugeeth/XLM/src/data/loader.py", line 309, in check_data_params
        assert all([all([os.path.isfile(p1) and os.path.isfile(p2) for p1, p2 in paths.values()]) for pat
hs in params.para_dataset.values()])
AssertionError

Can you tell me are there any additional steps to be followed to do so ? I want to pretrain a model and then use it for training a supervised MT task. Did I miss something kindly let me know if there is any end to end tutorial for supervised MT training. Kindly help.
Thanks in advance .

@stanisz93
Copy link

Could you show what files are in processed folder?

@sugeeth14
Copy link
Author

Hi @stanisz93 In data/processed I have a folder named
en-de
in that folder I have the below files

codes        test.en-de.de      test.en-de.en      test.en.pth  train.de.pth  train.en-de.de      train.en-de.en      train.en.pth  valid.en-de.de      valid.en-de.en      valid.en.pth  vocab.en
test.de.pth  test.en-de.de.pth  test.en-de.en.pth  train.de     train.en      train.en-de.de.pth  train.en-de.en.pth  valid.de.pth  valid.en-de.de.pth  valid.en-de.en.pth  vocab.de      vocab.en-de

@zyuuyuu
Copy link

zyuuyuu commented May 30, 2019

Same error here. Any update on how this could be fixed?

@glample
Copy link
Contributor

glample commented May 31, 2019

Hi,

Can you try to have a look at which file is missing? Typically, if this line is failing:
assert all([all([os.path.isfile(p1) and os.path.isfile(p2) for p1, p2 in paths.values()]) for paths in params.para_dataset.values()])

Try to replace it with:

for paths in params.para_dataset.values():
    for p1, p2 in paths.values()
        if not os.path.isfile(p1):
            print(p1)
        if not os.path.isfile(p2):
            print(p2)

And see the output?

@zyuuyuu
Copy link

zyuuyuu commented May 31, 2019

Solved the issue. Thanks!

@glample glample closed this as completed Jun 2, 2019
@KelleyYin
Copy link

Solved the issue. Thanks!

Did you reproduce the En-De results reported in the paper ?

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

No branches or pull requests

5 participants