fawazsammani / nlxgpt

NLX-GPT: A Model for Natural Language Explanations in Vision and Vision-Language Tasks, CVPR 2022 (Oral)
44 stars 10 forks source link

No such file or directory: 'cococaption/annotations/vqaX_test_annot_exp.json' #5

Closed dschaehi closed 2 years ago

dschaehi commented 2 years ago

Hi @fawazsammani,

Thank you for the sharing the code! I have a little issue in training the model on VQA-X. The training script complains that file cococaption/annotations/vqaX_test_annot_exp.json is missing. Indeed there is no such a file in that folder (cf.~https://github.com/ruotianluo/coco-caption/tree/ea20010419a955fed9882f9dcc53f2dc1ac65092/annotations). Could you help me with this issue? Thank you.

Below is the full error message:

Evaluation: Finished 1967/1968          loading annotations into memory...
Traceback (most recent call last):
  File "/data/lee/home/Projects/nlxgpt/vqaX.py", line 595, in <module>
    filter_and_get_scores(
  File "/data/lee/home/Projects/nlxgpt/vqaX.py", line 126, in filter_and_get_scores
    coco = COCO(annFileExp)
  File "/data/lee/home/Projects/nlxgpt/cococaption/pycocotools/coco.py", line 76, in __init__
    dataset = json.load(open(annotation_file, 'r'))
FileNotFoundError: [Errno 2] No such file or directory: 'cococaption/annotations/vqaX_test_annot_exp.json'
Traceback (most recent call last):
  File "/export/home/lee/miniconda3/envs/nlx-gpt/bin/accelerate", line 8, in <module>
    sys.exit(main())
  File "/export/home/lee/miniconda3/envs/nlx-gpt/lib/python3.9/site-packages/accelerate/commands/accelerate_cli.py", line 43, in main
    args.func(args)
  File "/export/home/lee/miniconda3/envs/nlx-gpt/lib/python3.9/site-packages/accelerate/commands/launch.py", line 837, in launch_command
    simple_launcher(args)
  File "/export/home/lee/miniconda3/envs/nlx-gpt/lib/python3.9/site-packages/accelerate/commands/launch.py", line 354, in simple_launcher
    raise subprocess.CalledProcessError(returncode=process.returncode, cmd=cmd)
subprocess.CalledProcessError: Command '['/export/home/lee/miniconda3/envs/nlx-gpt/bin/python3.9', 'vqaX.py']' returned non-zero exit status 1.
fawazsammani commented 2 years ago

Hi @dschaehi I have uploaded the annotations file. Please see the README.md. Sorry that I forgot to upload them.

Regards

dschaehi commented 2 years ago

Hi @fawazsammani,

Thank you for your reply! The code works so far. By the way, for coco caption I had to follow the setup procedure (i.e.., downloading Stanford CoreNLP 3.6.0 and Google News negative 300 word2vec model) to correctly install it. This is missing in the current README.md of this repo. Perhaps you can consider including it.

fawazsammani commented 2 years ago

@dschaehi Google News negative 300 word2vec model is only required for WMD, which we do not use. As for Stanford CoreNLP, the instructions are already in the cococaption repo.

Regards

dschaehi commented 2 years ago

@fawazsammani Yes, but based on the current README.md I was only required to download coco caption and put it in the cococaption folder. I took this instruction "literally" (i.e., I just downloaded it) and did not try to follow the installation guideline in the coco caption repo. Maybe it was my fault.

By the way, without the Google News negative 300 word2vec model I got the error message below. So I had to download it with the script provided by the coco caption repo.


FileNotFoundError: [Errno 2] No such file or directory: '/data/lee/home/Projects/nlxgpt/cococaption/pycocoevalcap/wmd/data/GoogleNews-vectors-negative300.bin'  
fawazsammani commented 2 years ago

@dschaehi you have to also comment out the line: from .wmd.wmd import WMD in the script coco-caption/pycocoevalcap/eval.py. But nevermind if you already installed it.

Regards

dschaehi commented 2 years ago

@fawazsammani Thanks for the tip. I am currently trying to reproduce the results on the paper. I'll let you know if there is any issue.