OpenGVLab / InternVL

[CVPR 2024 Oral] InternVL Family: A Pioneering Open-Source Alternative to GPT-4o. 接近GPT-4o表现的开源多模态对话模型
https://internvl.readthedocs.io/en/latest/
MIT License
5.14k stars 403 forks source link

Floating point exception (core dumped) #278

Closed hjklearn closed 3 weeks ago

hjklearn commented 2 months ago

When I run 'Model Usage (Image Embeddings) ':

import torch from PIL import Image from transformers import AutoModel, CLIPImageProcessor model = AutoModel.from_pretrained( 'OpenGVLab/InternViT-300M-448px', torch_dtype=torch.bfloat16, low_cpu_mem_usage=True, trust_remote_code=True).cuda().eval() image = Image.open('./examples/image1.jpg').convert('RGB') image_processor = CLIPImageProcessor.from_pretrained('OpenGVLab/InternViT-300M-448px') pixel_values = image_processor(images=image, return_tensors='pt').pixel_values pixel_values = pixel_values.to(torch.bfloat16).cuda() outputs = model(pixel_values)

it generates the following error: Floating point exception (core dumped)

josephzpng commented 1 month ago

hello! I also have the same problem, have you solved it?

h66840 commented 3 weeks ago

It may be that your cuda version is too old, my cuda version 11.1 also had this error, replaced by 11.8 to solve the problem

czczup commented 3 weeks ago

It may be that your cuda version is too old, my cuda version 11.1 also had this error, replaced by 11.8 to solve the problem

That might be the reason. My CUDA version is 11.8.