facebookresearch / fairseq

Facebook AI Research Sequence-to-Sequence Toolkit written in Python.
MIT License
30.49k stars 6.41k forks source link

why are some batchsize outputs garbled? #4328

Open kkeleve opened 2 years ago

kkeleve commented 2 years ago

❓ Questions and Help

I'm currently training a GEC task. I'm currently training a GEC task with fairseq on Ubuntu and using my checkpoint get a normal translation,but for some reasons I need to use Google colab, so i moved the project to Google colab, and loaded the same checkpoint to translate the same test data, but there were garbled characters, and the translation result of some batchsizes was None. Can anyone answer this for me?

Code

%cd /content/engec_fairseq_tmp/generic-pretrained-GEC/BART-GEC !pip install --editable ./ import os os.environ['PYTHONPATH'] += ":/content/engec_fairseq_tmp/generic-pretrained-GEC/BART-GEC" !CUDA_VISIBLE_DEVICES=0 python translate.py \ /content/engec_fairseq_tmp/out/checkpoints \ /content/drive/input/train.combine.en_00 \ /content/drive/output

What have you tried?

What's your environment?

image

gmryu commented 2 years ago

I wonder if the rest part of colab translation is the same as the normal one. If they are the same, then does google colab show these words at first? (i.e. you open the normal translation.txt in your google colab and print out the content)

If the translation is different, then you can edit your cloned fairseq/fairseq/models/bart (or maybe you are using custom model) add some print/logger.info for more detailed calculation progress. (I actually do this for my transformer in a rough way).

At last, there is few information about how you get the translation, so I believe this is all I get for now.