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

关于 训练 fnlp/cpt-large,出现 维度不一致问题 #62

Open
km1994 opened this issue Apr 5, 2023 · 1 comment
Open

关于 训练 fnlp/cpt-large,出现 维度不一致问题 #62

km1994 opened this issue Apr 5, 2023 · 1 comment

Comments

@km1994
Copy link

km1994 commented Apr 5, 2023

我用以下命令 训练 fnlp/cpt-large
python train.py --train_file /mnt/kaimo/data/summary/bidding/train.json --dev_file /mnt/kaimo/data/summary/bidding/dev.json --batch_size 2 --max_epochs 10 --max_source_length 1024 --max_target_length 1024 --model_path fnlp/cpt-large --gpus 1 --lr 5e-5 --model_type cpt

但是报错了,报错内容为“

RuntimeError: Error(s) in loading state_dict for CPTForConditionalGeneration: size mismatch for model.encoder.embeddings.position_ids: copying a param with shape torch.Size([1, 1024]) from checkpoint, the shape in current model is torch.Size([1, 512]). size mismatch for model.encoder.embeddings.position_embeddings.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). You may consider adding ignore_mismatched_sizes=Truein the modelfrom_pretrained method.

请问是哪个地方出问题?

@renmada
Copy link
Owner

renmada commented Apr 6, 2023

可能我下载的权重比较早,cpt后来模型有更新。代码已更新,适配最新的fnlp/cpt-large

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