Skip to content
This repository was archived by the owner on Jun 3, 2025. It is now read-only.

Commit fb990da

Browse files
authored
fixing yolo collate function indexing (#48)
1 parent 84969d2 commit fb990da

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/sparseml/pytorch/datasets/detection/helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def yolo_collate_fn(
125125
annotations = []
126126
for idx, (image, (target, annotation)) in enumerate(batch):
127127
images.append(image.unsqueeze(0))
128-
img_label = torch.ones(target.size(0), 1)
128+
img_label = torch.ones(target.size(0), 1) * idx
129129
targets.append(torch.cat((img_label, target), 1))
130130
annotations.append(annotation)
131131

0 commit comments

Comments
 (0)