Question: I am new to NLP and would like to build a BERT model for sentiment analysis so I am following [this](https://curiousily.com/posts/sentiment-analysis-with-bert-and-hugging-face-using-pytorch-and-python/) 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

```

Answer: 
**How to obtain the same behavior as v3.x in v4.x**
In order to obtain the same behavior as version v3.x, you should install sentencepiece additionally:

In version v3.x:

*pip install transformers*

to obtain the same in version v4.x:

pip install transformers[sentencepiece]
or

pip install transformers sentencepiece
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