Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Torch version may causes an error #4

Open
ichimiya13 opened this issue Jun 11, 2024 · 1 comment
Open

Torch version may causes an error #4

ichimiya13 opened this issue Jun 11, 2024 · 1 comment

Comments

@ichimiya13
Copy link

Hi, thank you for your great work! Following your setup instruction, I ran the commands below.

conda env create -f cola.yml
cd ..
git lfs clone https://huggingface.co/OFA-Sys/ofa-large
python query/query_ofa.py --vlm-model-path ../OFA-large --data-dir ./datasets/ --dataset-name aokvqa --split val --vlm-task vqa --bs 128 --prediction-out ./predictions/aokvqa_ofa_vqa_val-da.json

Then, I got an error.

Traceback (most recent call last):
  File "/home/usr/Python/VQA/Cola/query/query_ofa.py", line 125, in <module>
    run_ofa(args)
  File "/home/usr/Python/VQA/Cola/query/query_ofa.py", line 99, in run_ofa
    gen = ofa_model.generate(
          ^^^^^^^^^^^^^^^^^^^
  File "/home/usr/anaconda3/envs/cola2/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/usr/anaconda3/envs/cola2/lib/python3.10/site-packages/transformers/generation/utils.py", line 1597, in generate
    model_kwargs = self._prepare_encoder_decoder_kwargs_for_generation(

It seems that the version of torch and transformers causes this error, could you tell me your environment?
I tried on the following environment.

22.04.1-Ubuntu
conda 23.7.2
CUDA Version: 12.2
Driver Version: 535.171.04
NVIDIA GeForce RTX 4090
@cliangyu
Copy link
Owner

Can you try transformers v4.34?
An alternative fix is to avoid encoder-decoder transformers. You may want to try llava_next.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants