diff --git a/train.py b/train.py index d31ffd26..0f939769 100644 --- a/train.py +++ b/train.py @@ -174,7 +174,7 @@ def train( t, t0 = time.time(), time.time() for epoch in range(start_epoch, epochs): model.train() - print(('\n%8s%12s' + '%10s' * 7) % ('Epoch', 'Batch', 'xy', 'wh', 'conf', 'cls', 'total', 'nTargets', 'time')) + print(('\n%8s%12s' + '%10s' * 7) % ('Epoch', 'Batch', 'xy', 'wh', 'conf', 'cls', 'total', 'targets', 'time')) # Update scheduler scheduler.step() diff --git a/utils/datasets.py b/utils/datasets.py index 912c91a7..054eb9e0 100755 --- a/utils/datasets.py +++ b/utils/datasets.py @@ -199,6 +199,7 @@ class LoadImagesAndLabels(Dataset): # for training/testing except: print('Warning: missing labels for %s' % self.img_files[i]) pass # missing label file + assert len(np.concatenate(self.labels, 0)) > 0, 'No labels found. Check label paths.' def __len__(self): return len(self.img_files)