salesforce / LAVIS

LAVIS - A One-stop Library for Language-Vision Intelligence
BSD 3-Clause "New" or "Revised" License
9.65k stars 943 forks source link

[img2llm_vqa] LAVIS requires transformers>=4.28.0 but CLIP doesn't support transformers>=4.27 #443

Open MiaQiu opened 1 year ago

MiaQiu commented 1 year ago

Hello team,

I am trying to run the demo of img2llm_vqa from: https://colab.research.google.com/github/salesforce/LAVIS/blob/main/projects/img2llm-vqa/img2llm_vqa.ipynb#scrollTo=7428ac2d

I encounter issues where LAVIS requires transformers>=4.28.0 but CLIP doesn't support transformers>=4.27 Requirement already satisfied: transformers>=4.28.0 in /usr/local/lib/python3.10/dist-packages (from salesforce-lavis==1.0.1) Error message when trying to load_model_and_preprocess(name="img2prompt_vqa", model_type="base", is_eval=True, device=device): "BLIP models are not compatible with transformers>=4.27, run pip install transformers==4.25 to downgrade"

Is there a workaround or the dependencies will be fixed?

Thanks! Mia

kopyl commented 1 year ago

Are you installing levis from git?

like !pip install 'git+https://github.com/salesforce/LAVIS.git'

MiaQiu commented 1 year ago

Thank you for your quick revert. Yes, here is the code i copied from the demo:

import sys if 'google.colab' in sys.modules: print('Running in Colab.') !git clone https://github.com/salesforce/LAVIS %cd LAVIS !pip install . !pip3 install https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.0.0/en_core_web_sm-3.0.0.tar.gz

RookieXwc commented 1 year ago

I have the same issue, Lavis requires version>4.28, but there are the following errors:

AssertionError: BLIP models are not compatible with transformers>=4.27, run pip install transformers==4.25 to downgrade

RookieXwc commented 1 year ago

@kopyl Could you please help me solve it? Thank you!

kopyl commented 1 year ago

@RookieXwc not sure, sorry :(

Davidwhw commented 4 months ago

I have the same issue, Lavis requires version>4.28, but there are the following errors:

AssertionError: BLIP models are not compatible with transformers>=4.27, run pip install transformers==4.25 to downgrade

Did you solve the problem?