Closed athos17 closed 1 year ago
你好,你可以重新Clone一下,因为Github仓库的代码是我从我项目里摘的,可能我漏覆盖了collate文件,现在已经加上了,如果运行后还有其他问题,欢迎回复
您好,我在修改之后成功生成了test.csv文件,但在运行joint_evaluate.py时仍出现了如下报错:
Traceback (most recent call last):
File "E:\新建文件夹\FCGEC-main\model\STG-correction\joint_evaluate.py", line 148, in repo_type
argument if needed.
希望您能告诉我怎么解决
这个问题是因为你没有配置预训练模型的参数,你可以看看run_stg_joint.sh的PLM_PATH,需要设置为你自己的,如果你本地没有的话可以从HF里或者哈工大的repo里下载,PLM。
请问是在运行bash文件后运行joint_evaluate.py吗,我在更改参数后还是同样的报错
PLM_PATH是你运行bash文件之前设置的,如果你直接使用joint_evaluate.py,需要在evaluate_joint_config.py文件中lm_path参数的默认值。
您好,在使用您提供的第二种方法后,我解决了上述报错,但又出现了以下报错 RuntimeError: Error(s) in loading state_dict for JointModel: size mismatch for tagger._hidden2t.linear.weight: copying a param with shape torch.Size([6, 768]) from checkpoint, the shape in current model is torch.Size([8, 768]). size mismatch for tagger._hidden2t.linear.bias: copying a param with shape torch.Size([6]) from checkpoint, the shape in current model is torch.Size([8]).
我已经解决了上述报错,谢谢您的帮助
客气啦:)
您好,在使用您提供的第二种方法后,我解决了上述报错,但又出现了以下报错 RuntimeError: Error(s) in loading state_dict for JointModel: size mismatch for tagger._hidden2t.linear.weight: copying a param with shape torch.Size([6, 768]) from checkpoint, the shape in current model is torch.Size([8, 768]). size mismatch for tagger._hidden2t.linear.bias: copying a param with shape torch.Size([6]) from checkpoint, the shape in current model is torch.Size([8]).
你好,我也遇到了相同的问题,请问是怎么解决的? Unexpected key(s) in state_dict: "switch._encoder._bert.embeddings.position_ids", "tagger._encoder._bert.embeddings.position_ids", "generator._lmodel.bert.embeddings.position_ids". size mismatch for tagger._hidden2t.linear.weight: copying a param with shape torch.Size([6, 768]) from checkpoint, the shape in current model is torch.Size([8, 768]). size mismatch for tagger._hidden2t.linear.bias: copying a param with shape torch.Size([6]) from checkpoint, the shape in current model is torch.Size([8]).
你好,我也遇到了相同的问题,请问是怎么解决的? Unexpected key(s) in state_dict: "switch._encoder._bert.embeddings.position_ids", "tagger._encoder._bert.embeddings.position_ids", "generator._lmodel.bert.embeddings.position_ids". size mismatch for tagger._hidden2t.linear.weight: copying a param with shape torch.Size([6, 768]) from checkpoint, the shape in current model is torch.Size([8, 768]). size mismatch for tagger._hidden2t.linear.bias: copying a param with shape torch.Size([6]) from checkpoint, the shape in current model is torch.Size([8]).
@yazheng0307 你好,
如果你是直接用的joint_evaluate.py,需要修改evaluate_joint_config.py中的max_generate参数的默认值为5
来匹配权重的维度。
报错如下: Traceback (most recent call last): File "E:\新建文件夹\FCGEC-main\model\STG-correction\preprocess_data.py", line 4, in
from utils.argument import ArgumentGroup
File "E:\新建文件夹\FCGEC-main\model\STG-correction\utils__init__.py", line 12, in
from utils.collate import collate_fn_base, collate_fn_tagger, collate_fn_joint, collate_fn_tagger_V2, collate_fn_bertbase_tti, collate_fn_tagger_V2TTI, collate_fn_jointV2, collate_fn_demo
ImportError: cannot import name 'collate_fn_demo' from 'utils.collate' (E:\新建文件夹\FCGEC-main\model\STG-correction\utils\collate.py)
请问这个函数是需要自己写吗?