RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension 0. Got 3 and 2 in dimension 1

Thanks for reply , however ,the quote seems not dealing with the problem we are facing .

We want to deal with the problem that the number of labels is not certain , but the quote takes care of the variable size of the images.

I tried to imitate it to write “my_collate” , but it didn’t work .