RuntimeError: The size of tensor a (4) must match the size of tensor b (3) at non-singleton

这个错误主要是因为,数据的数量不能整除batch size的数量,改正方法有两种

  1. 将batch size改称可以被 数据量整除即可。

  2. 将dataloader 中的 drop_last改称False也可。

Logo

有“AI”的1024 = 2048,欢迎大家加入2048 AI社区

更多推荐