jadore801120/attention-is-all-you-need-pytorch

TranslationDataset is now deprecated in torchtext

imkzh opened this issue · 2 comments

imkzh commented

Since TranslationDataset is deprecated (see Issue 985), could you please kindly update the relevant code to work with newer version of torchtext?

> python preprocess.py -lang_src de -lang_trg en -share_vocab -save_data m30k_deen_shr.pkl

Traceback (most recent call last):
    File "preprocess.py", line 15, in <module>
    from torchtext.datasets import TranslationDataset
ImportError: cannot import name 'TranslationDataset' from 'torchtext.datasets' 

The current version number of torchtext is 0.12.0.

Also: what version of torchtext may current code in this repository work with?

Up to now, the latest version of torchtext is 0.11.2, which discarded the TranslationDataset. If you want to use TranslationDataset, please install torchtext==0.3.1.

R-N commented

You can use 0.6.0, but the hardcoded dataset link in 0.3.1 - 0.6.0 is dead.
I patched it up a bit here https://github.com/R-N/torchtext/tree/0.6.1