Cyanogenoid / pytorch-vqa

Strong baseline for visual question answering
238 stars 97 forks source link

Issue with train_loader and val_loader in train.py #13

Closed superhans closed 6 years ago

superhans commented 6 years ago

Hello,

I wanted a way to look at the images in the main training/validation loop of train.py

I wasn't able to do this.

On the one hand, the images from tq.iterable.dataset.coco_ids does not sync with the question and answers (which do sync).

On the other hand, the dictionary tq.iterable.dataset.coco_id_to_index contains 123287 keys, which means that it contains both train and validation sets (82783+40504).

When I "reverse" this dictionary, the mapping from idx (where idx comes from for v, q, a, idx, q_len in tq:) to coco_id isn't correct (for example, idx from the val_loader maps to coco_ids in the training set).

Could you take a look at this?

Cyanogenoid commented 6 years ago

Have you tried modifying https://github.com/Cyanogenoid/pytorch-vqa/blob/master/data.py#L154 to return image_id and using that?

superhans commented 6 years ago

Yes, That works.