OFA-Sys / OFA

Official repository of OFA (ICML 2022). Paper: OFA: Unifying Architectures, Tasks, and Modalities Through a Simple Sequence-to-Sequence Learning Framework
Apache License 2.0
2.39k stars 248 forks source link

ConfigKeyError on VQA inference #212

Open Rosiekk opened 2 years ago

Rosiekk commented 2 years ago

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!

yangapku commented 2 years ago

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

eugfomitcheva commented 1 year ago

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?

yangapku commented 1 year ago

@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?

eugfomitcheva commented 1 year ago

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?

25icecreamflavors commented 1 year ago

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.

sunnie-star commented 6 months ago

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 commented 6 months ago

@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!