pytorch报错: invalid argument 0: Sizes of tensors must match except in dimension 0.

This problem is encountered in dataloader, general online are different dimensions of data, but I'm here really is the last data and previous data than the number of deficiencies, it is not enough to scrape together a batch, so my approach is to add drop_last = True meaning If the data is not enough to give up the last batch.

Published 302 original articles · won praise 161 · views 490 000 +

Guess you like

Origin blog.csdn.net/qq_32146369/article/details/103321203