I am trying to use the fairseq toolkit for the first time and I have started from the ready tutorials. In the character level RNN example,i.e
https://fairseq.readthedocs.io/en/latest/tutorial_classifying_names.html.
I was able to perform the following steps :
1)Preprocessing the data to create dictionaries.
2)Registering a new Model that encodes an input sentence with a simple RNN and predicts the output label.
3)Registering a new Task that loads our dictionaries and dataset.
But when I try to train the model with the following command I get an error :+1:
fairseq-train names-bin \
--task simple_classification \
--arch pytorch_tutorial_rnn \
--optimizer adam --lr 0.001 --lr-shrink 0.5 \
--max-tokens 1000
The error that I get is as follows :
fairseq-train: error: argument --task: invalid choice: 'simple_classification' (choose from 'cross_lingual_lm', 'language_modeling', 'sentence_prediction', 'masked_lm', 'sentence_ranking', 'multilingual_masked_lm', 'audio_pretraining', 'translation', 'multilingual_translation', 'denoising', 'translation_lev', 'translation_moe', 'translation_from_pretrained_xlm', 'semisupervised_translation', 'legacy_masked_lm')
Apparently it seems not to be able to fetch the task. I checked and the simple_classification.py file is there at the right directory. What might be the cause of the problem? Thanks in advance and stay healthy!
I am running the code on Google Colab Notebook
Please follow the issue template. Specifically, include which tutorial you are following, what command you ran, and a paste of the full backtrace and error you are seeing.
Hopefully the new information is enough !
How did you install fairseq? do python -c "import fairseq; print(fairseq.__file__)" and ensure that it corresponds to the same directory your new task is in.
Since I am using Colab notebook,I do the following :
from google.colab import drive
drive.mount("/content/gdrive")
%cd "/content/gdrive/My Drive/Colab Notebooks"
!pip install fairseq
!git clone https://github.com/pytorch/fairseq
%cd fairseq
So the fairseq folder gets cloned into Colab Notebooks folder in my Google Drive. Thanks !
Sure, but the fairseq that you pip installed is different than the one that you cloned. Instead of doing pip install fairseq, you should cd into your local checkout and run pip install --editable . This will ensure that the version you install is the same version that you are modifying.
Thank you that solved my problem ! I spent 5 days on this small issue !
@redionxhepa can you put a screenshot of the way in which you installed fairseq in colab?
Most helpful comment
Thank you that solved my problem ! I spent 5 days on this small issue !