dandelin / ViLT

Code for the ICML 2021 (long talk) paper: "ViLT: Vision-and-Language Transformer Without Convolution or Region Supervision"
Apache License 2.0
1.38k stars 207 forks source link

RuntimeError: indices should be either on cpu or on the same device as the indexed tensor (cpu) #81

Open jiajia95Murphy opened 1 year ago

jiajia95Murphy commented 1 year ago

VQA runtimeError with GPU The command I entered:python demo_vqa.py with num_gpus=1 load_path="weights/vilt_vqa.ckpt"

20230413-195810

python: 3.8 CUDA: 11.7 pytorch: 1.13.0

sri13 commented 1 year ago

Any resolution on this issue?

happyphonon commented 1 year ago

I don't know what's the cause, but manually add patch_index = patch_index.to("cuda:0") should fix this error.