BERT :dropout(): argument 'input' (position 1) must be Tensor, not str I am new to NLP and would like to build a BERT model for sentiment analysis so I am following this tutorial.
However, I am getting the error below:
F.softmax(model(input_ids, attention_mask), dim = 1)

When I would like to execute this cell I get the error:
 dropout(): argument 'input' (position 1) must be Tensor, not str
Which transformer version are you using? I had to pin mine to transformer == 3.5.1 to mitigate that problem, when the hugging face team updated their transformer to 4.0 things started to break.
Hope it helps