kdexd / virtex

[CVPR 2021] VirTex: Learning Visual Representations from Textual Annotations
http://kdexd.xyz/virtex
MIT License
556 stars 61 forks source link

scripts/eval_captioning.py error #8

Closed Lavrikov closed 4 years ago

Lavrikov commented 4 years ago

Hi, I'v got following error File "scripts/eval_captioning.py", line 114, in main(_A) File "scripts/eval_captioning.py", line 76, in main val_batch[key] = val_batch[key].to(device) AttributeError: 'list' object has no attribute 'to'

i'v made following changes in code to run script without error: for val_iteration, val_batch in enumerate(val_dataloader, start=1):

for key in val_batch:

        #print(val_batch[key])
    val_batch["image"] = val_batch["image"].to(device)
kdexd commented 4 years ago

Thanks @Lavrikov! This bug was introduced after I added ImageDirectoryDataset to support #1. I pushed the fix to master! :tada: