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

Generate "OOOOOOOOOOOOOOOOOOOOO" instead of words #621

Closed
SamuraiBUPT opened this issue Dec 23, 2023 · 4 comments
Closed

Generate "OOOOOOOOOOOOOOOOOOOOO" instead of words #621

SamuraiBUPT opened this issue Dec 23, 2023 · 4 comments

Comments

@SamuraiBUPT
Copy link

Hello, I follow the tutorial in instructblip and pick a test image. But its output seems to be weird.

Code:

from lavis.models import load_model_and_preprocess

test_img2 = Image.open('../dataset/fashion-new/images-raw/test_img.jpg').convert('RGB')      # open the image and convert to RGB
display(test_img2.resize((256, 378)))

model_instructBlip, vis_processors, _ = load_model_and_preprocess(name="blip2_vicuna_instruct", 
                                                                    model_type="vicuna7b", 
                                                                    is_eval=True, 
                                                                    device=device)

image_ = vis_processors["eval"](test_img2).unsqueeze(0).to(device)
caption_test = model_instructBlip.generate({"image": image_, "prompt": "Describe the man's clothes."})
print(caption_test)

output:

image

['OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO']

I wonder what step I missed or did wrong to get this result.

Any help will be appreciated.

@SamuraiBUPT
Copy link
Author

Problem solved, I used vicuna-7b-v1.5, not vicuna-7b-v1.1, sorry to bother.

@purshow
Copy link

purshow commented Jan 23, 2024

Hi bro!I meet the same question.Could you teach me how to solve it?

@SamuraiBUPT
Copy link
Author

Hi bro!I meet the same question.Could you teach me how to solve it?

The reason my model generated "OOOOOOOO" is that I was using vicuna-7b-1.5, but actually, according to the document of LAVIS, you should use vicuna-7b-1.1 instead. The instruct-blip model seems not to be capable with vicuna version 1.5.

Please check your vicuna version to avoid using model of wrong version.

@purshow
Copy link

purshow commented Mar 6, 2024

Thanks!

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