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

Inference error: size mismatch for model.mm_projector.weight #19

Open
gameveloster opened this issue Jan 31, 2024 · 1 comment
Open

Comments

@gameveloster
Copy link

After doing a lora finetuning on the pretrained model using finetune_lora.sh, I tried to do inference using CLI

python -m llava.serve.cli \
    --model-path ./checkpoints/llava-Mistral-7B-v0.1-finetune_lora_1 \
    --model-base /models/llm/Mistral-7B-v0.1 \
    --image-file "https://llava-vl.github.io/static/images/view.jpg"

and received this error when loading non_lora_trainables.bin into the model

RuntimeError: Error(s) in loading state_dict for LlavaMistralForCausalLM:
	size mismatch for model.mm_projector.weight: copying a param with shape torch.Size([4096, 1024]) from checkpoint, the shape in current model is torch.Size([2097152, 1]).

There is no problem loading the Bakkala-1 checkpoint by running

python -m llava.serve.cli \
    --model-path /models/lmm/BakLLaVA-1 \
    --image-file "https://llava-vl.github.io/static/images/view.jpg"

Can I have some help to solve this crash when trying to use the LoRA created from the finetuning please? Thank you

@zhyhome
Copy link

zhyhome commented Mar 11, 2024

How did you solve this problem?

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