-
Notifications
You must be signed in to change notification settings - Fork 8
Vocab Size Mismatch #9
Copy link
Copy link
Open
Description
使用官方requirements.txt里面的 transformers==4.38.2 在测试时可以顺利测试,但发现使用 transformers==4.56 时运行
model = SegEarthR2.from_pretrained(model_path, mask_decoder_cfg=mask_cfg, **kwargs)
会报错词表大小不一致, 错误信息:
RuntimeError: Error(s) in loading state_dict for Linear:
size mismatch for weight: copying a param with shape torch.Size([50296, 2560]) from checkpoint, the shape in current model is torch.Size([51200, 2560]).
因为在llava_phi.py中lm_head硬编码为51200 (Mipha词表大小),但是训练权重下config.vocab_size: 50296, 这是否代表测试时 lm_head为随机初始化参数并没有加载权重参数, 只不过在低版本 transformers 版本下容许了这种行为?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels