-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Converting tf rubert files to pytorch #863
Comments
Hi!
We will probably update our RuBERT checkpoint to be compatible with pytorch converting tool soon. |
Thanks. |
I got
when tried to do the same |
@K-Mike Did you set up correct path to RuBERT checkpoint? |
Checked it again, yes I'm sure (tokenizer works well with the same path). |
Can you provide code example and full trace back? |
Yes, maybe you tell me what I do wrong
|
Can you try to use absolute path for |
Not help, but if change name Is it ok, that there are only: |
No, that is not okay. I've checked that we have 5 files in |
Thanks! Very strange behavior, I downloaded the file 4 times and there always were 3 files only, when I downloaded in linux, there are 5 files. |
Hello.
I would like to convert rubert tf-files to pytorch.
I use code form https://github.com/huggingface/pytorch-pretrained-BERT/blob/master/pytorch_pretrained_bert/convert_tf_checkpoint_to_pytorch.py
But i have assert:
Initialize PyTorch weight ['bert', 'embeddings', 'LayerNorm', 'beta'] Initialize PyTorch weight ['bert', 'embeddings', 'LayerNorm', 'gamma'] Initialize PyTorch weight ['bert', 'embeddings', 'position_embeddings'] Skipping bert/embeddings/position_embeddings/AdamWeightDecayOptimizer Traceback (most recent call last): File "/usr/lib/python3.5/runpy.py", line 184, in _run_module_as_main "__main__", mod_spec) File "/usr/lib/python3.5/runpy.py", line 85, in _run_code exec(code, run_globals) File "/home/repos/pytorch-pretrained-BERT/pytorch_pretrained_bert/convert_tf_checkpoint_to_pytorch.py", line 67, in <module> args.pytorch_dump_path) File "/home/repos/pytorch-pretrained-BERT/pytorch_pretrained_bert/convert_tf_checkpoint_to_pytorch.py", line 38, in convert_tf_checkpoint_to_pytorch load_tf_weights_in_bert(model, tf_checkpoint_path) File "/home/repos/pytorch-pretrained-BERT/pytorch_pretrained_bert/modeling.py", line 116, in load_tf_weights_in_bert assert pointer.shape == array.shape File "/usr/local/lib/python3.5/dist-packages/torch/nn/modules/module.py", line 535, in __getattr__ type(self).__name__, name)) AttributeError: 'Embedding' object has no attribute 'shape'
This is due to the fact that the number of initial components has been changed in rubert model?
The text was updated successfully, but these errors were encountered: