LLaVA-NeXT icon indicating copy to clipboard operation
LLaVA-NeXT copied to clipboard

Weight shape mismatch

Open byungokhan opened this issue 1 year ago • 6 comments
trafficstars

I finetuned "llava-onevision-qwen2-7b-si" using my custom data.

After the fine-tuning process, I tried to inference using my finetuned model.

But, when I use the load_pretrained_model function, I met an error like this:

ValueError: Trying to set a tensor of shape torch.Size([152064, 3584]) in "weight" (which has shape torch.Size([151936, 3584])), this looks incorrect.

128 dimension is missing.

Can you help me about this problem?

byungokhan avatar Aug 27 '24 11:08 byungokhan

I do have the same problem, try to use this. overwrite_config = {'tie_word_embeddings': True, 'use_cache': True, "vocab_size": 152064}

ChipsICU avatar Aug 27 '24 15:08 ChipsICU

if this work for you, plz let me know, thks.

ChipsICU avatar Aug 27 '24 15:08 ChipsICU

Thanks. It does work with transformers==4.40.0 (downgraded) But, the inference result is completely wrong, , as if there is an issue with the tokenizer. Like this; ["duction less1 leaving111 RightRing剧烈 numericaltool'),\nige less lesstool11tooltooltooltooltool lesstooltooltool tractor2namesCharlestooltooltooltooltooltooltooltooltooltooltooltooltooltooltooltooltooltooltooltooltooltooltooltooltooltool Deadline(line Browseelsing Lans哪些、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、"]

How do you think?

byungokhan avatar Aug 27 '24 16:08 byungokhan

@byungokhan Now we have the same problem, LOL!

ChipsICU avatar Aug 27 '24 17:08 ChipsICU

BTW, 0.5b works fine.

ChipsICU avatar Aug 27 '24 17:08 ChipsICU

Any suggestion for this problem?

byungokhan avatar Aug 27 '24 23:08 byungokhan

@ChipsICU This works for 7b. overwrite_config = {'tie_word_embeddings': False, 'use_cache': True, "vocab_size": 152064}

byungokhan avatar Aug 28 '24 04:08 byungokhan

Works for me as well! Many thks.

ChipsICU avatar Aug 28 '24 05:08 ChipsICU