HillZhang1999 / SynGEC

Code & data for our EMNLP2022 paper "SynGEC: Syntax-Enhanced Grammatical Error Correction with a Tailored GEC-Oriented Parser"
https://arxiv.org/abs/2210.12484
MIT License
79 stars 14 forks source link

在chinese_hsk+lang8数据上跑bart-large模型失败 #23

Closed sxh617 closed 1 year ago

sxh617 commented 1 year ago

您好,我根据chinese_exp里的preprocess_baseline.sh脚本处理chinese_hsk+lang8数据后,再跑train_syngec_bart.sh脚本里的第一个baseline实验,报 RuntimeError: Error(s) in loading state_dict for SyntaxEnhancedBARTModel: size mismatch for encoder.sentence_encoder.embed_tokens.weight: copying a param with shape torch.Size([51275, 1024]) from checkpoint, the shape in current model is torch.Size([21132, 1024]). size mismatch for encoder.sentence_encoder.embed_positions.weight: copying a param with shape torch.Size([1026, 1024]) from checkpoint, the shape in current model is torch.Size([514, 1024]). size mismatch for decoder.embed_tokens.weight: copying a param with shape torch.Size([51275, 1024]) from checkpoint, the shape in current model is torch.Size([21132, 1024]). size mismatch for decoder.embed_positions.weight: copying a param with shape torch.Size([1026, 1024]) from checkpoint, the shape in current model is torch.Size([514, 1024]). size mismatch for decoder.output_projection.weight: copying a param with shape torch.Size([51275, 1024]) from checkpoint, the shape in current model is torch.Size([21132, 1024]). 而且好像数据处理的词典大小只有21132,而fnlp/bart-large-chinese里的词典大小为51275

HillZhang1999 commented 1 year ago

请使用fnlp/bart-large-chinese的v1.0版本:https://huggingface.co/fnlp/bart-large-chinese/tree/v1.0