Cadene / murel.bootstrap.pytorch

MUREL (CVPR 2019), a multimodal relational reasoning module for VQA
https://arxiv.org/abs/1902.09487
BSD 3-Clause "New" or "Revised" License
194 stars 24 forks source link

Training on subset of classes #6

Closed nithinraok closed 5 years ago

nithinraok commented 5 years ago

Hello,

I tried adapting the code to train for just binary yes/no questions, but while it was loading batch, it is throwing an error as shown below:

Screen Shot 2019-04-16 at 4 01 40 PM

I changed the following : Edited trainset.pth, validset.pth to contain only yes/no questions and annotations in options/vqa2/murel.yaml changed the output_dim to 2 for final layer. and changed batchsize to 8

After googling found the error could be because the labels is exceeding n_classes (2), but we couldn't figure out why. :(

Cadene commented 5 years ago

I think that you should change the answer dictionaries aid_to_ans and ans_to_aid to contain yes and no classes only, associated with the label 0 and the label 1.


Remi Cadene PhD Student at LIP6 Sorbonne University http://remicadene.com 0033635504788

Le mer. 17 avr. 2019 à 01:07, Nithin Rao notifications@github.com a écrit :

Hello,

I tried adapting the code to train for just binary yes/no questions, but while it was loading batch, it is throwing an error as shown below:

[image: Screen Shot 2019-04-16 at 4 01 40 PM] https://user-images.githubusercontent.com/19668129/56249540-fd0b1680-6060-11e9-82e1-7b66f4a5db08.png

I changed the following : Edited trainset.pth, validset.pth to contain only yes/no questions and annotations in options/murel.yml changed the output_dim to 2 for final layer. and changed batchsize to 8

After googling found the error could be because the labels is exceeding n_classes (2), but we couldn't figure out why. :(

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Cadene/murel.bootstrap.pytorch/issues/6, or mute the thread https://github.com/notifications/unsubscribe-auth/AEdvLiovoWm1JgrFCaAA5OwHsM9h9HBKks5vhlebgaJpZM4cz3_C .

nithinraok commented 5 years ago

Sorry, forgot to mention we changed that as well. 1 for Yes and 0 for no and added those changes accordingly in block/datasets/vqa_utils.py file

Cadene commented 5 years ago

You should probably make sure that the answer_id of the items in your batch corresponds to 0 or 1. https://github.com/Cadene/block.bootstrap.pytorch/blob/master/block/datasets/vqa2.py#L82


Remi Cadene PhD Student at LIP6 Sorbonne University http://remicadene.com 0033635504788

Le mer. 17 avr. 2019 à 08:03, Nithin Rao notifications@github.com a écrit :

Sorry, forgot to mention we changed that as well. 1 for Yes and 0 for no

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Cadene/murel.bootstrap.pytorch/issues/6#issuecomment-483949108, or mute the thread https://github.com/notifications/unsubscribe-auth/AEdvLkpGdRKl1du1pI7Mlf8GBbm9akThks5vhrk6gaJpZM4cz3_C .