yuleiniu / cfvqa Goto Github PK
View Code? Open in Web Editor NEW[CVPR 2021] Counterfactual VQA: A Cause-Effect Look at Language Bias
License: Apache License 2.0
[CVPR 2021] Counterfactual VQA: A Cause-Effect Look at Language Bias
License: Apache License 2.0
Could you please share the code to extract image features "2018-04-27_bottom-up-attention_fixed_36" or the pre-trained RCNN?
Hi @yuleiniu Thank you for your great work!
I have some questions related to the core idea, hoping answering them will make the paper more clear for me.
1- In equations 11, 12, and 13 you are replacing the learned embeddings by a learnable constant, how this constant may be interpreted? what does it imply?
2- Why fixing this constant across the whole dimension, by multiplying it to ones?
3- Following this,
z_qkv = self.fusion(logits, q_pred, v_pred, q_fact=True, k_fact=True, v_fact=True) # te
z_q = self.fusion(logits, q_pred, v_pred, q_fact=True, k_fact=False, v_fact=False) # nie
logits_cfvqa = z_qkv - z_q
if we neglect the non-linearity (z = torch.log(torch.sigmoid(z) + eps)), (z_qkv - z_q) will be interpreted as (z_k + z_q + z_v) - (2C + z_q) which means we can just rely from the beginning on z_k + z_v and remove the QA branch?! I think I missunderstand something here :D
4- Is it possible to replace the constant with other real example, such as augmented version of the input or something like that, what do u think?
Thanks in advance!
Hello, thanks for sharing your code!
I found a possible wrong in cfvqasimple.py
Isn't out['logits_all'] = z_qkv # for optimization
should be out['logits_all'] = z_qk # for optimization
? Or I took it wrong?
Hi @yuleiniu Thank you for your great work! I have two quick questions:
Could you please tell me whether this error affects the experimental results?
[I 2021-10-12 03:55:06] ...trap/engines/engine.py.126: Saving best checkpoint for strategy eval_epoch.accuracy_top1
[I 2021-10-12 03:55:06] ...trap/engines/engine.py.420: Saving model...
Traceback (most recent call last):
File "/data/gaokuofeng/anaconda3/envs/cfvqa/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/data/gaokuofeng/anaconda3/envs/cfvqa/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/data/gaokuofeng/anaconda3/envs/cfvqa/lib/python3.7/site-packages/block.bootstrap.pytorch-0.1.6-py3.7.egg/block/models/metrics/compute_oe_accuracy.py", line 8, in <module>
ModuleNotFoundError: No module named 'block.external'
[I 2021-10-12 03:55:07] ...trap/engines/engine.py.424: Saving optimizer...
[I 2021-10-12 03:55:10] ...trap/engines/engine.py.428: Saving engine...
[I 2021-10-12 03:55:10] ...trap/engines/engine.py.129: Saving last checkpoint
[I 2021-10-12 03:55:10] ...trap/engines/engine.py.420: Saving model...
[I 2021-10-12 03:55:11] ...trap/engines/engine.py.424: Saving optimizer...
[I 2021-10-12 03:55:14] ...trap/engines/engine.py.428: Saving engine...
[I 2021-10-12 03:55:14] ...trap/engines/engine.py.133: Ending training procedures
I'm confused about why proc_split
exists.
what will happen if I set proc_split = 'trainval'
when split = 'val'
?
Do you have the configuration yaml file for updn baseline?
Hi,
Recently I'm doing my own VQA work. In my case, the convergence speed in three categories (Y/N
, Num.
, Other
) are not same. Hence, the best result for each category may reveal in three different epoch. I'm little confused on how to choose the best result for each category.
So, in your work, how do you choose the best result for each category?
Choose the highest result for each category from all epochs result?
Or just choose one epoch which has highest All
score and choose all results from this epoch only?
Thank you for your outstanding work. When will the code be updated?
I can train all the other versions except smrl_cfvqa_rubi with batch_size = 256, I have to change it to 64 preventing CUDA out of memory
. But the training is too slow, which takes a day to train a epoch with three 3090.
I wonder what is the difference between smrl_cfvqa_rubi and other versions making it so speical, and is it normal to train so slowly? or is it because I did something wrong?
logs.txt
I try to run the baseline as "python -m bootstrap.run -o cfvqa/options/vqacp2/smrl_baseline.yaml", and got the logs.txt.
However, I cannot get the overall accuracy as similar in your paper (about 38.46), and how to get the accuracy of different question types (Y/N, other and number) from this log?
Should I run more epoch or change some super parameter?
Hi,
First of all, great work and a good paper!
I just want to clarify a few things! I followed the readme file and re-trained the following variants:
i) vqacp2 (smrl_baseline.yaml / smrl_cfvqa_sum.yaml /smrl_cfvqasimple_sum.yaml)
ii) vqa2 (smrl_baseline.yaml / smrl_cfvqa_sum.yaml /smrl_cfvqasimple_sum.yaml)
However, the evaluation results were different from the results reported in the paper.
Thank you for your time.
What should be the weight of the error in the different parts?I've found that the training effect is worse when the KL divergence loss weight is not 1, and when the KL divergence weight is larger, the training effect is poor.
Hello Yulei Niu. Thank you very much for your inspiring work, it has given me great inspiration. I have a question that I hope you can answer: In your paper, under equation 17, there is a sentence "Only c is updated when minimizing L_kl", but in the code, I don't see how it is implemented, it seems that L_kl is added to the whole loss.
What do the following parameters mean in the.yaml file in the options folder?
self_q_att
q_single
Hi, thanks for sharing your code! In README, I think boostrap.run
under the Use a Specific GPU section shall be bootstrap.run
.
No such file or directory: 'data/vqa/coco/extract_rcnn/2018-04-27_bottom-up attention_fixed_36/COCO_val2014_000000144334.jpg.pth'
配置好环境后运行,在bootstrap/lib/logger.py里的json.dump()报TypeError: Object of type Tensor is not JSON serializable,请问作者有遇到这个问题吗?不解决是否可以,把logger.flush()注释掉后train和eval的结果都有了。
I found the files in the networks folder that the block module is introduced in the header file, such as "from block.models.networks.mlp import MLP". How do I get the block module?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.