How are your DataLoader and Dataset defined? Are you using custom ones?
The error indicates that when you group together tensors to create a mini-batch (the DataLoader does this with the collate function), you have tensors of different sizes, which cannot be stacked…