pytorch中报错IndexError: index 5 is out of bounds for dimension 0 with size 5
最近用pytorh复现yolov1时遇到上面的报错,想了很久最后查到是因为在Dataloader加载数据集时,如果不丢弃后面多余的batch,那么会出现这样的报错。举个例子:torch.Size([16,3,448,448])torch.Size([16,7,7,30]torch.Size([16,3,448,448])torch.Size([16,7,7,30]torch.Size([16,3,