VITA icon indicating copy to clipboard operation
VITA copied to clipboard

torch.Size([152064, 3584]) 不匹配 torch.Size([152064, 4096])问题

Open x-liang-xu opened this issue 10 months ago • 2 comments

执行完 Demo和 Basic Demo之间的命令之后,执行 python -m web_demo.web_ability_demo demo_VITA_ckpt/ 启动,报了一个size不匹配的错, 然后我去修改 demo_VITA_ckpt/origin_config.json 文件里的 audio_config.intermediate_size, 把 3584改成了4096,但是不生效,依旧报如下错误: Traceback (most recent call last): File "/data/miniconda3/envs/vita_demo/lib/python3.9/runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "/data/miniconda3/envs/vita_demo/lib/python3.9/runpy.py", line 87, in _run_code exec(code, run_globals) File "/data/VITA/web_demo/web_ability_demo.py", line 520, in main(args.model_path) File "/data/VITA/web_demo/web_ability_demo.py", line 498, in main llm_embedding = load_model_embemding(model_path).to(device) File "/data/VITA/web_demo/web_ability_demo.py", line 141, in load_model_embemding model = VITAQwen2ForCausalLM.from_pretrained(model_path, config=config, low_cpu_mem_usage=True) File "/data/miniconda3/envs/vita_demo/lib/python3.9/site-packages/transformers/modeling_utils.py", line 3960, in from_pretrained ) = cls._load_pretrained_model( File "/data/miniconda3/envs/vita_demo/lib/python3.9/site-packages/transformers/modeling_utils.py", line 4434, in _load_pretrained_model new_error_msgs, offload_index, state_dict_index = _load_state_dict_into_meta_model( File "/data/miniconda3/envs/vita_demo/lib/python3.9/site-packages/transformers/modeling_utils.py", line 961, in _load_state_dict_into_meta_model set_module_tensor_to_device(model, param_name, param_device, **set_module_kwargs) File "/data/miniconda3/envs/vita_demo/lib/python3.9/site-packages/accelerate/utils/modeling.py", line 287, in set_module_tensor_to_device raise ValueError( ValueError: Trying to set a tensor of shape torch.Size([152064, 3584]) in "weight" (which has shape torch.Size([152064, 4096])), this looks incorrect.

x-liang-xu avatar Jan 22 '25 09:01 x-liang-xu

抱歉,我觉得这个问题不难,但是我找不着关键点

x-liang-xu avatar Jan 22 '25 09:01 x-liang-xu

Please check if the package versions are correct, ensure all instructions in readme are correctly excuted. Here are some common issues others have faced that you can refer to: #56 #64 #92

lxysl avatar Jan 24 '25 09:01 lxysl