Skip to content

Commit

Permalink
add instruction for VQA and VCR evaluation
Browse files Browse the repository at this point in the history
  • Loading branch information
jiasenlu committed Aug 22, 2019
1 parent 603c646 commit 40d675c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ python eval_retrieval.py --bert_model bert-base-uncased --from_pretrained save/R
2: To test on held out validation split, use the following command:

```
python eval_tasks.py --bert_model bert-base-uncased --from_pretrained save/VQA_bert_base_6layer_6conect-pretrained/pytorch_model_19.bin --config_file config/bert_base_6layer_6conect.json --task 0 --split minval
```

### VCR
Expand All @@ -81,13 +81,13 @@ python eval_retrieval.py --bert_model bert-base-uncased --from_pretrained save/R
2: To test on VCR Q->A

```
python eval_tasks.py --bert_model bert-base-uncased --from_pretrained save/VCR_Q-A-VCR_QA-R_bert_base_6layer_6conect-pretrained/pytorch_model_19.bin --config_file config/bert_base_6layer_6conect.json --task 1 --split val
```

3: To test on VCR QA->R

```
python eval_tasks.py --bert_model bert-base-uncased --from_pretrained save/VCR_Q-A-VCR_QA-R_bert_base_6layer_6conect-pretrained/pytorch_model_19.bin --config_file config/bert_base_6layer_6conect.json --task 2 --split val
```

### RefCOCO+
Expand Down
3 changes: 3 additions & 0 deletions vilbert/datasets/vcr_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ def __init__(
if row[1] != 'name':
self._names.append(row[1])

if not os.path.exists(os.path.join(dataroot, "cache")):
os.makedirs(os.path.join(dataroot, "cache"))

# cache file path data/cache/train_ques
cache_path = "data/VCR/cache/" + split + '_' + task + "_" + str(max_seq_length) + "_" + str(max_region_num) + "_vcr.pkl"
if not os.path.exists(cache_path):
Expand Down

0 comments on commit 40d675c

Please sign in to comment.