Can you show us the line you used to create the model? Then to debug a bit, you can do:
for batch in trainer.get_train_dataloader():
    print({k: v.shape for k, v in batch.items()})

This will make sure you can assemble of a batch data and print the shapes of each key. Please execute it and print the result here 
Then we can check the batch goes through the model:
outputs = trainer.model(**batch)
print(outputs)

and see what the outputs look like. With all of that we should be able to diagnose the problem.