facebookresearch / FiD

Fusion-in-Decoder
Other
551 stars 107 forks source link

Tutorial about using pretrained models #7

Closed infopg closed 3 years ago

infopg commented 3 years ago

Hello,

I want to use the pre-trained model and evaluate the pre-trained model according to the example usage of the provided script. My code is as follows:

python test_reader.py \ --model_path pretrained_models/nq_readers_base \ --eval_data open_domain_data/TQA/dev.json \ --per_gpu_batch_size 4 \ --n_context 100 \ --name my_test \ --checkpoint_dir checkpoint \ --write_crossattention_scores \

But when I ran the code, it shows that their is an error in /src/data.py

Traceback (most recent call last): File "test_reader.py", line 108, in world_size=opt.world_size File "/root/FiD/src/data.py", line 131, in load_data if global_rank > -1 and not k%world_size==global_rank: ZeroDivisionError: integer division or modulo by zero

Could you please tell me is there a problem with my code and provide some more detailed guidelines or examples?

Thanks in any help!

Sherry

PeterDykas commented 2 years ago

Were you able to figure out the solution to this issue? I am running into the same problem.

gowtham1997 commented 2 years ago

This happens if you are running your code on CPU or torch isn't correctly installed to use your gpus