ZhuiyiTechnology / simbert

a bert for retrieval and generation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

预训练模型checkpoint转换pytorch出错

lidw-chinese opened this issue · comments

想把chinese_simbert_L-4_H-312_A-12转换成pytorch版本,出现了错误,请问大佬怎么解决呢?
File "E:/project/ws/convert.py", line 63, in
convert_tf_checkpoint_to_pytorch(tf_checkpoint_path, bert_config_file, pytorch_dump_path)
File "E:/project/ws/convert.py", line 34, in convert_tf_checkpoint_to_pytorch
load_tf_weights_in_bert(model, config, tf_checkpoint_path)
File "D:\ProgramData\Miniconda3\envs\tf2.3-cpu\lib\site-packages\transformers\models\bert\modeling_bert.py", line 158, in load_tf_weights_in_bert
), f"Pointer shape {pointer.shape} and array shape {array.shape} mismatched"
AssertionError: ('Pointer shape torch.Size([312]) and array shape (128,) mismatched', torch.Size([312]), (128,))

不清楚,不懂pytorch