The source code for our paper Learning to Contrast the Counterfactual Samples for Robust Visual Question Answering published in EMNLP 2020. This repo contains code modified from CSS-VQA, Many thanks for their efforts.
Make sure you are on a machine with a NVIDIA GPU and Python 2.7 with about 100 GB disk space.
h5py==2.10.0
pytorch==1.1.0
Click==7.0
numpy==1.16.5
tqdm==4.35.0
All data preprocess and set up please refer to bottom-up-attention-vqa
- Please run the script to download the data.
bash tools/download.sh
All the args for running our code is preset in the main.py.
Run
CUDA_VISIBLE_DEVICES=0 python main.py
to train a model
Run
CUDA_VISIBLE_DEVICES=0 python eval.py --dataset [] --debias [] --model_state []
to eval a model
If you find this paper helps your research, please kindly consider citing our paper in your publications.
@inproceedings{liang2020learning,
title={Learning to Contrast the Counterfactual Samples for Robust Visual Question Answering},
author={Liang, Zujie and Jiang, Weitao and Hu, Haifeng and Zhu, Jiaying},
booktitle={Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP)},
year={2020}
}