I just had this problem and it was fixed after setting padding = "max_length" in the tokenizer function. (this is in response to RuntimeError: stack expects each tensor to be equal size, but got [99] at entry 0 and [111] at entry 1 )