InternLM / InternLM/InternLM-XComposer

ValueError: Input image size (490*490) doesn't match model (336*336).

Open
#461 5 comments 0 reactions 1 assignee Claimed by @yhcao6 View on GitHub
Dominant language
Python
Stars
2.9k
Forks
175
PR merge metrics
No merged PRs in 30d

Description

When I ran the example inference code for model xcomposer2-vl-7b provided in the huggingface page:
```
import torch
from transformers import AutoModel, AutoTokenizer

torch.set_grad_enabled(False)

# init model and tokenizer
model = AutoModel.from_pretrained('internlm/internlm-xcomposer2-vl-7b', trust_remote_code=True).cuda().eval()
tokenizer = AutoTokenizer.from_pretrained('internlm/internlm-xcomposer2-vl-7b', trust_remote_code=True)

query = 'Please describe this image in detail.'
image = 'Our image path'

with torch.cuda.amp.autocast():
response, _ = model.chat(tokenizer, query=query, image=image, history=[], do_sample=False)
print(response)
```

I got an error:
`ValueError: Input image size (490*490) doesn't match model (336*336)`

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.