albert_pytorch icon indicating copy to clipboard operation
albert_pytorch copied to clipboard

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

Open wyqnumber opened this issue 4 years ago • 0 comments

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'

谢谢

wyqnumber avatar Jun 24 '20 07:06 wyqnumber