This commit is contained in:
Glenn Jocher 2019-05-02 15:47:27 +02:00
parent 7e6e1897ac
commit ae41d5855a
1 changed files with 1 additions and 1 deletions

View File

@ -179,7 +179,7 @@ class LoadImagesAndLabels(Dataset): # for training/testing
# self.imgs = [cv2.imread(img_files[i]) for i in range(n)] # self.imgs = [cv2.imread(img_files[i]) for i in range(n)]
# Preload labels (required for weighted CE training) # Preload labels (required for weighted CE training)
self.labels = [np.array([])] * n self.labels = [np.zeros((0, 5))] * n
iter = tqdm(self.label_files, desc='Reading labels') if n > 1000 else self.label_files iter = tqdm(self.label_files, desc='Reading labels') if n > 1000 else self.label_files
for i, file in enumerate(iter): for i, file in enumerate(iter):
try: try: