Skip to content

Commit a6fbdc0

Browse files
committed
Clone boxes tensor to avoid mutating ground truth
1 parent 2199fd9 commit a6fbdc0

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)