[URGENT ! !]RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension 0. Got 128 and 0 in dimension 2 at /opt/conda/conda-bld/pytorch_1544199946412/work/aten/src/TH/generic/THTensorMoreMath.cpp:1333

I have a problem, described as follows:

and the error part from the code is

Anyone knows how to solve it? thanks advance!

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…

Hi, there is something wrong with your dataloader, I think you should check you data sizes.