Fairseq: Invalid syntax when running the pre-processing script

Created on 25 Dec 2019  路  3Comments  路  Source: pytorch/fairseq

I am trying to execute one of the translation examples in the files, the IWSLT'14 German to English (Transformer) specifically. Running the codes using the command lines below:

python preprocess.py --source-lang de --target-lang en --trainpref examples/translation/iwslt14.tokenized.de-en/train --validpref examples/translation/iwslt14.tokenized.de-en/valid --testpref examples/translation/iwslt14.tokenized.de-en/test --destdir data-bin/iwslt14.tokenized.de-en

returns the following error:

File "preprocess.py", line 293 print("{} {}".format(src_dict[k], tgt_dict[v]), file=f) ^ SyntaxError: invalid syntax

preprocess_error

What am I doing wrongly?

question

Most helpful comment

Oh! that's true I already fixed that. Thanks.
But I now have a new error
AttributeError: module 'torch.utils.data' has no attribute 'IterableDataset'

error2

All 3 comments

What version of Python are you using? Fairseq requires Python >= 3.6.

Oh! that's true I already fixed that. Thanks.
But I now have a new error
AttributeError: module 'torch.utils.data' has no attribute 'IterableDataset'

error2

Was this page helpful?
0 / 5 - 0 ratings