This commit is contained in:
Glenn Jocher 2020-01-11 13:13:57 -08:00
parent 9b84885775
commit 4b56a370e6
1 changed files with 1 additions and 1 deletions

View File

@ -499,7 +499,7 @@ class LoadImagesAndLabels(Dataset): # for training/testing
@staticmethod
def collate_fn(batch):
img, label, path, shapes = list(zip(*batch)) # transposed
img, label, path, shapes = zip(*batch) # transposed
for i, l in enumerate(label):
l[:, 0] = i # add target image index for build_targets()
return torch.stack(img, 0), torch.cat(label, 0), path, shapes