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

预训练模型checkpoint转换pytorch出错 #21

Open
lidw-chinese opened this issue Sep 14, 2021 · 1 comment
Open

预训练模型checkpoint转换pytorch出错 #21

lidw-chinese opened this issue Sep 14, 2021 · 1 comment

Comments

@lidw-chinese
Copy link

想把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,))

@bojone
Copy link

bojone commented Dec 29, 2021

不清楚,不懂pytorch

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