Closed yashkumaratri closed 6 years ago
Tried the solution proposed by @renhongkai in https://github.com/nusnlp/mlconvgec2018/issues/2#issuecomment-364710330
But a new error popped up
.............
.....................
+ python3.5 /home/ubuntu/mlconvgec2018/software/fairseq-py/generate.py --no-progress-bar --path models/mlconv_embed//model1.pt --path models/mlconv_embed//model2.pt --path models/mlconv_embed//model3.pt --path models/mlconv_embed//model4.pt --beam 12 --nbest 12 /home/ubuntu/mlconvgec2018/models/data_bin
Traceback (most recent call last):
File "/home/ubuntu/mlconvgec2018/software/fairseq-py/generate.py", line 171, in <module>
main(args)
File "/home/ubuntu/mlconvgec2018/software/fairseq-py/generate.py", line 34, in main
task = tasks.setup_task(args)
File "/home/ubuntu/mlconvgec2018/software/fairseq-py/fairseq/tasks/__init__.py", line 19, in setup_task
return TASK_REGISTRY[args.task].setup_task(args)
File "/home/ubuntu/mlconvgec2018/software/fairseq-py/fairseq/tasks/translation.py", line 88, in setup_task
src_dict = Dictionary.load(os.path.join(args.data, 'dict.{}.txt'.format(args.source_lang)))
File "/home/ubuntu/mlconvgec2018/software/fairseq-py/fairseq/data/dictionary.py", line 93, in load
with open(f, 'r') as fd:
FileNotFoundError: [Errno 2] No such file or directory: '/home/ubuntu/mlconvgec2018/models/data_bin/dict.en.txt'
and there are 2 dictionary files in data_bin.
So How to make your code to work ?
To make the scripts work and replicate exact results, you have to use the specified Fairseq commit in download.sh (which requires PyTorch 0.2.0post3 compiled from source).
The latest version of Fairseq has numerous changes.
For example, in the latest version of Fairseq, generate.py --interactive
is replaced by a separate script interactive.py. Also, when you have to decode with multiple models, instead of giving them as
--path models/mlconv_embed//model1.pt --path models/mlconv_embed//model2.pt --path models/mlconv_embed//model3.pt --path models/mlconv_embed//model4.pt
you have to give:
--path models/mlconv_embed//model1.pt:models/mlconv_embed//model2.pt:models/mlconv_embed//model3.pt:models/mlconv_embed//model4.pt
If you are using the latest Fairseq, do not rely on the released shell scripts as they were written for an older version that is used in this work. You will have to follow the Fairseq documentation and use the released models alone. It may perhaps be better to retrain models using the latest version of Fairseq and test using the same.
OS : Ubuntu 16.04 Python Version : 3.5 CUDA : 8
Whenever I setup farseq-py by running
python3 setup.py install
(The one which gets downloaded by download.sh script) I getBut as per issue#2 I used latest fairseq but now I am running in lot of conflict like
Now the question is how to use that
./run.sh --------------------------------------------------
to make it inference.