Skip to content

Commit b262983

Browse files
author
kuangliu
authored
Merge pull request #19 from tarrencev/loader_fix
Clone boxes tensor to avoid mutating ground truth
2 parents 2199fd9 + a6fbdc0 commit b262983

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

datagen.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ def __getitem__(self, idx):
7777
img = Image.open(os.path.join(self.root, fname))
7878
if img.mode != 'RGB':
7979
img = img.convert('RGB')
80-
81-
boxes = self.boxes[idx]
80+
81+
boxes = self.boxes[idx].clone()
8282
labels = self.labels[idx]
8383
size = self.input_size
8484

0 commit comments

Comments
 (0)