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

将brightmart中预训练的TensorFlow模型转换为Pytorch模型报如下错误,'Embedding' object has no attribute 'shape' #54

Open
wyqnumber opened this issue Jun 24, 2020 · 0 comments

Comments

@wyqnumber
Copy link

INFO:model.modeling_albert_bright:Initialize PyTorch weight ['bert', 'embeddings', 'position_embeddings']
INFO:model.modeling_albert_bright:Skipping bert/embeddings/position_embeddings/lamb_m
Traceback (most recent call last):
File "convert_albert_tf_checkpoint_to_pytorch.py", line 59, in
args.pytorch_dump_path)
File "convert_albert_tf_checkpoint_to_pytorch.py", line 34, in convert_tf_checkpoint_to_pytorch
load_tf_weights_in_albert(model, config, tf_checkpoint_path)
File "/data/albert_pytorch-master/model/modeling_albert_bright.py", line 88, in load_tf_weights_in_albert
assert pointer.shape == array.shape
File "/home/lib/python3.6/site-packages/torch/nn/modules/module.py", line 535, in getattr
type(self).name, name))
AttributeError: 'Embedding' object has no attribute 'shape'

谢谢

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

1 participant