Open JoKerDii opened 3 years ago
Figured it out by looking at this. It seems either specifying 'return_dict=False' or calling 'values()' method could force the bert model to return a tuple.
It's working with the older version. Try with transformers==3.0.2 version.
Yeah, you are right, thanks!
@JoKerDii Did you specify return_dict=False where bert model was downloaded?
I mean
bert = AutoModel.from_pretrained('bert-base-uncased', return_dict=False)
From this stackoverflow question,
After some 3.X version syntax in model architecture (forward pass) has got little changed.
_, cls_hs = self.bert(sent_id, attention_mask=mask)
x = self.fc1(cls_hs)
cls_hs = self.bert(sent_id, attention_mask=mask)
x = self.fc1(cls_hs[1])
I got ' 'str' object has no attribute 'dim'' by simply running the notebook. Any idea where is the error?