ModuleNotFoundError: No module named 'fairseq/examples'

964 views
Skip to first unread message

devik...@gmail.com

unread,
Jul 7, 2020, 4:56:15 PM7/7/20
to fairseq Users
Hi,

I've been trying to run the official code for fine-tuning BART on CNN/DM. When running the following lines in the terminal, I get the a module not found error:

TASK=cnn_dm
for SPLIT in train val
do
  for LANG in source target
  do
    python -m examples.roberta.multiprocessing_bpe_encoder \
    --encoder-json encoder.json \
    --vocab-bpe vocab.bpe \
    --inputs "$TASK/$SPLIT.$LANG" \
    --outputs "$TASK/$SPLIT.bpe.$LANG" \
    --workers 60 \
    --keep-empty;
  done
done

~/anaconda3/envs/myenv2/bin/python: Error while finding module specification for 'fairseq/examples.roberta.multiprocessing_bpe_encoder' (ModuleNotFoundError: No module named 'fairseq/examples').


I installed fairseq according to the instructions on the Github page by the authors. Please let me know if I'm doing something wrong! TIA.

voice dl

unread,
Oct 3, 2023, 6:59:12 AM10/3/23
to fairseq Users
same here. Did you have any progress with that?

sheema firdous

unread,
Oct 28, 2023, 12:47:57 PM10/28/23
to fairseq Users
Hi,
If you are using colab for this, "pip install fairseq" will resolve this error. You will also need to manually clone the fairseq repo in current directory.

Thanks. 

Reply all
Reply to author
Forward
0 new messages