QwenLM / Qwen2-VL

Qwen2-VL is the multimodal large language model series developed by Qwen team, Alibaba Cloud.
Apache License 2.0
2.55k stars 144 forks source link

ValueError: You are trying to offload the whole model to the disk. Please use the `disk_offload` function instead. #90

Open ProgrammerPlus1998 opened 1 month ago

ProgrammerPlus1998 commented 1 month ago

版本:python3.10 系统:macos(m3) 为了使代码可以在M3运行,向下修改了两个包的版本。

torch==2.2.2
torchvision==0.17.2

异常信息: (Qwen2-VL) aaa@aaadeMacBook-Pro-2 Qwen2-VL % python web_demo_mm.py
/opt/anaconda3/envs/Qwen2-VL/lib/python3.10/site-packages/accelerate/utils/modeling.py:1462: UserWarning: Current model requires 939531344 bytes of buffer for offloaded layers, which seems does not fit any GPU's remaining memory. If you are experiencing a OOM later, please consider using offload_buffers=True. warnings.warn( Loading checkpoint shards: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████| 5/5 [00:00<00:00, 179243.76it/s] Traceback (most recent call last): File "/Users/aaa/PycharmProjects/Qwen2-VL/web_demo_mm.py", line 297, in main() File "/Users/aaa/PycharmProjects/Qwen2-VL/web_demo_mm.py", line 292, in main model, processor = _load_model_processor(args) File "/Users/aaa/PycharmProjects/Qwen2-VL/web_demo_mm.py", line 61, in _load_model_processor model = Qwen2VLForConditionalGeneration.from_pretrained(args.checkpoint_path, device_map=device_map) File "/opt/anaconda3/envs/Qwen2-VL/lib/python3.10/site-packages/transformers/modeling_utils.py", line 4046, in from_pretrained dispatch_model(model, **device_map_kwargs) File "/opt/anaconda3/envs/Qwen2-VL/lib/python3.10/site-packages/accelerate/big_modeling.py", line 496, in dispatch_model raise ValueError( ValueError: You are trying to offload the whole model to the disk. Please use the disk_offload function instead.

ProgrammerPlus1998 commented 1 month ago

有没有明白人可以帮忙解答一下