masakhane-io / masakhane-mt

Machine Translation for Africa
MIT License
277 stars 206 forks source link

Some issues with the "into English" MT starter notebook #160

Open bmensah opened 3 years ago

bmensah commented 3 years ago

https://github.com/masakhane-io/masakhane-mt/blob/master/starter_notebook_into_English_training.ipynb

When training a Twi-to-English model, I ran into a couple of challenges. Though these errors may have been due to something I overlooked, I thought it best to post here in case these small updates could help future users:

In the third from last code block, the current code is: !cp -r joeynmt/models/${tgt}${src}_reverse_transformer/* "$gdrive_path/models/${src}${tgt}_reverse_transformer/"

This can be fixed simply with these lines:

mkdir "$gdrive_path/models/${tgt}${src}_reverse_transformer/"
!cp -r joeynmt/models/${tgt}${src}_reverse_transformer/* "$gdrive_path/models/${tgt}${src}_reverse_transformer/"

When trying to test my model in the last code block, I got an error because a checkpoint could not be found. I fixed this by using the checkpoint flag:

original line: ! cd joeynmt; python3 -m joeynmt test "$gdrive_path/models/${tgt}${src}_reverse_transformer/config.yaml"

suggested update: ! cd joeynmt; python3 -m joeynmt test "$gdrive_path/models/${tgt}${src}_reverse_transformer/config.yaml" --ckpt "$gdrive_path/models/${tgt}${src}_reverse_transformer/$filename.ckpt"