OpenGVLab / OpenGVLab/InternVideo

some error about internvideo 2.5 demo.py

Open
#243 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2.4k
Forks
160
PR merge metrics
No merged PRs in 30d

Description

1.In Huggingface or modelscope the newest demo.py forget to set IMAGENET_MEAN and IMAGENET_STD
2.After fixing this issue run demo.py, error is : Input type(c10:BFloat16) and bias type(c10:Half)should be the same.

for error 1:
set them will work
IMAGENET_MEAN = (0.485, 0.456, 0.406)
IMAGENET_STD = (0.229, 0.224, 0.225)

for error 2:
pixel_values = pixel_values.to(torch.bfloat16).to(model.device) change to pixel_values = pixel_values.to(torch.float16).to(model.device) can work.
But if I want to use bfloat16 to inference, how can I solve this problem?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the newest demo.py referenced for the Hugging Face or ModelScope demo and reproduce both reported errors. Check the image-normalization constants and the pixel_values dtype conversion, then verify that inference completes with bfloat16 without a dtype mismatch; no specific test file is mentioned.

Written by the indexing model from the issue text.

Assessment

Tech stack
huggingface, python, pytorch
Domain
computer-vision, machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.