OFA icon indicating copy to clipboard operation
OFA copied to clipboard

ConfigKeyError on VQA inference

Open Rosiekk opened this issue 2 years ago • 7 comments

Dear authors, Thanks for your excellent work! But when I follow the VQA inference steps, I encounter the following problems.

  1. When I use scripts evaluate_vqa_allcand.sh and evaluate_vqa_allcand.sh for multi-GPU inference, there is an error: RuntimeError: CUDA error: invalid device ordinal. However, I've checked the index of CUDA_VISIBLE_DEVICES and the pytorch version fits the CUDA version (RTX 3090 Ti, CUDA 10.1--pytorch 1.8.1, torchvision 0.9.1).
  2. I try fine-tuning with a single GPU CUDA_VISIBLE_DEVICES=0 python3 ../../evaluate.py and it doesn't report the CUDA error any more, but a new error exist:
omegaconf.errors.ConfigKeyError: Key 'outputs' not in 'VqaGenConfig'
        full_key: outputs
        reference_type=Optional[VqaGenConfig]
        object_type=VqaGenConfig

There isn't an "outputs" key in the scripts nor in the definition of class VqaGenConfig, I just wonder how to fix it? Thank you so much for your help!

Rosiekk avatar Aug 24 '22 03:08 Rosiekk

Hi, could you please share the exact script you ran?

yangapku avatar Aug 31 '22 11:08 yangapku

Hi - I am encountering this issue as well when trying to run beam search inference. I have created an environment with the requirements installed, have downloaded necessary data and checkpoints.

I am running bash evaluate_vqa_beam.sh test on two GPUs and receive: omegaconf.errors.ConfigKeyError: Key 'train_ans2label_file' not in 'VqaGenConfig' full_key: train_ans2label_file reference_type=Optional[VqaGenConfig] object_type=VqaGenConfig

I am not finding a fix for this error - any advice?

eugfomitcheva avatar Oct 18 '22 18:10 eugfomitcheva

@eugfomitcheva Hi, could you please share the exact script you ran? Meanwhile, are you using the fairseq codebase included in this OFA repo or using the official fairseq?

yangapku avatar Oct 20 '22 06:10 yangapku

This is actually a good point @yangapku - fairseq in the repo wouldn't build for me (issue #270 ) so I created a new environment and installed it from scratch there. The underlying problem may the error I mentioned where I receive ERROR: Failed building wheel for pycocotools ERROR: Failed building editable for fairseq when running pip install -r requirements.txt. Would you know the resolution to this?

eugfomitcheva avatar Oct 20 '22 18:10 eugfomitcheva

Hi, I have the same issue with Key 'train_ans2label_file' not in 'VqaGenConfig' full_key: train_ans2label_file. I don't think that I have problems with the fairseq, since all imports are done ok.

I tried to run the script on 1-2 gpu and always got errors.

Edit: No, it appeared that I had problems with fairseq.

25icecreamflavors avatar Nov 08 '22 04:11 25icecreamflavors

Hi, I have the same issue with Key 'train_ans2label_file' not in 'VqaGenConfig' full_key: train_ans2label_file. I don't think that I have problems with the fairseq, since all imports are done ok.

I tried to run the script on 1-2 gpu and always got errors.

Edit: No, it appeared that I had problems with fairseq.

Hi, you can try the suggestion —— "using the fairseq codebase included in this OFA repo” and that truly works for me.

sunnie-star avatar Mar 12 '24 13:03 sunnie-star

@eugfomitcheva Hi, could you please share the exact script you ran? Meanwhile, are you using the fairseq codebase included in this OFA repo or using the official fairseq?

Thank you very much!

sunnie-star avatar Mar 12 '24 13:03 sunnie-star