Environment info
transformers version: 4.2.2
- Platform: Linux-5.4.0-65-generic-x86_64-with-debian-buster-sid
- Python version: 3.7.7
- PyTorch version (GPU?): 1.8.0.dev20201202 (False)
- Tensorflow version (GPU?): not installed (NA)
- Using GPU in script?: No
- Using distributed or parallel set-up in script?: No
Who can help
@julien-c @stefan-it @LysandreJik
Information
Model I am using: DistilBert
The problem arises when using:
from transformers import DistilBertTokenizer, DistilBertModel
import torch
tokenizer = DistilBertTokenizer.from_pretrained('distilbert-base-german-cased')
model = DistilBertModel.from_pretrained('distilbert-base-german-cased')
The tasks I am working on is:
To reproduce
Steps to reproduce the behavior:
- Simply run the code above
- See the error message:
Traceback (most recent call last):
File "/home/tarask/Desktop/Work/Code/Git/probabilistic-gesticulator/my_code/data_processing/annotations/encode_text.py", line 5, in <module>
model = DistilBertModel.from_pretrained('distilbert-base-german-cased')
File "/home/tarask/anaconda3/envs/gesture_flow/lib/python3.7/site-packages/transformers/modeling_utils.py", line 1034, in from_pretrained
model = cls(config, *model_args, **model_kwargs)
File "/home/tarask/anaconda3/envs/gesture_flow/lib/python3.7/site-packages/transformers/models/distilbert/modeling_distilbert.py", line 419, in __init__
self.embeddings = Embeddings(config) # Embeddings
File "/home/tarask/anaconda3/envs/gesture_flow/lib/python3.7/site-packages/transformers/models/distilbert/modeling_distilbert.py", line 89, in __init__
n_pos=config.max_position_embeddings, dim=config.dim, out=self.position_embeddings.weight
File "/home/tarask/anaconda3/envs/gesture_flow/lib/python3.7/site-packages/transformers/models/distilbert/modeling_distilbert.py", line 76, in create_sinusoidal_embeddings
out[:, 0::2] = torch.FloatTensor(np.sin(position_enc[:, 0::2]))
RuntimeError: a view of a leaf Variable that requires grad is being used in an in-place operation.
Expected behavior
No errors
Environment info
transformersversion: 4.2.2Who can help
@julien-c @stefan-it @LysandreJik
Information
Model I am using: DistilBert
The problem arises when using:
The tasks I am working on is:
Word2Vec encoding
To reproduce
Steps to reproduce the behavior:
Expected behavior
No errors