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

I use the key "fps" instead of "video_fps." ,but it still doesn't work !!! #351

Open
jackhexiangyu12 opened this issue Oct 14, 2024 · 1 comment

Comments

@jackhexiangyu12
Copy link

#65

I use the key "fps" instead of "video_fps." ,but it still doesn't work !!!
messages = [
{
"role": "user",
"content": [
{
"type": "video",

"video": "IMG_3309.MOV",

"video": "test1.mp4",
"max_pixels": 360 * 420,
"fps": 2.0,
},
{"type": "text", "text": text1},
],
}
]

(Qwen2-VL-2B-Instruct1) hxy@thor:~$ python /media/ssd4/hxy/LLaVA-Video-72B-Qwen2/Qwen2-VL-2B-Instruct1.py
Qwen2VLRotaryEmbedding can now be fully parameterized by passing the model config through the config argument. All other arguments will be removed in v4.46
Loading checkpoint shards: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:01<00:00, 1.42it/s]
请输入问题:有什么
qwen-vl-utils using torchvision to read video.
Traceback (most recent call last):
File "/media/ssd4/hxy/LLaVA-Video-72B-Qwen2/Qwen2-VL-2B-Instruct1.py", line 91, in
image_inputs, video_inputs = process_vision_info(messages)
File "/home/hxy/anaconda3/envs/Qwen2-VL-2B-Instruct1/lib/python3.9/site-packages/qwen_vl_utils/vision_process.py", line 332, in process_vision_info
video_inputs.append(fetch_video(vision_info))
File "/home/hxy/anaconda3/envs/Qwen2-VL-2B-Instruct1/lib/python3.9/site-packages/qwen_vl_utils/vision_process.py", line 260, in fetch_video
video = VIDEO_READER_BACKENDSvideo_reader_backend
File "/home/hxy/anaconda3/envs/Qwen2-VL-2B-Instruct1/lib/python3.9/site-packages/qwen_vl_utils/vision_process.py", line 193, in _read_video_torchvision
total_frames, video_fps = video.size(0), info["video_fps"]
KeyError: 'video_fps'

@nlp4whp
Copy link

nlp4whp commented Oct 16, 2024

I fixed it by pip install "torchvision<0.19.0" or "torchvision>0.19.0"`

For me, this KeyError is from here: vedio, audio, info = io.read_video(...), info would be like {'video_fps': 25.0, 'audio_fps': 48000}
but when I used torchvision==0.19.0, info would be an empty dict {}

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