magic-research / PLLaVA

Official repository for the paper PLLaVA
593 stars 40 forks source link

ValueError: The input provided to the model are wrong. The number of image tokens is 0 while the number of image given to the model is 1. This prevents correct indexing and breaks batch generation. #32

Open zhangchunjie1999 opened 6 months ago

zhangchunjie1999 commented 6 months ago

This problem occurred when I was running a demo of the 34b model. How can I fix this ?

![Uploading 截屏2024-05-11 11.17.01.png…]()

zhangchunjie1999 commented 6 months ago
截屏2024-05-11 11 17 01
KaiyueSun98 commented 6 months ago

same problem

zhangchunjie1999 commented 6 months ago

I found a solution.
In tasks/eval/model_util.py, remove ` # try:

processor = PllavaProcessor.from_pretrained(repo_id)

# except Exception as e:
#     processor = PllavaProcessor.from_pretrained('llava-hf/llava-1.5-7b-hf')`

and add: processor = PllavaProcessor.from_pretrained(repo_id) then: Install the required packages

MVPavan commented 6 months ago

Its image_token_index problem, looks like new LlamaTokenizer image_token_index = 64000 where as pllava config image_token_index = 64002, change it to 64000.

mztknhao1 commented 4 months ago

I solved the problem, downgrad the tokenizers version

zhangchunjie1999 commented 4 months ago

收到邮件了~   祝安!

bozagina commented 1 week ago

same problem

zhangchunjie1999 commented 1 week ago

收到邮件了~   祝安!