updates
This commit is contained in:
parent
c2950dbfb6
commit
b2abd46437
2
train.py
2
train.py
|
@ -174,7 +174,7 @@ def train(
|
||||||
t, t0 = time.time(), time.time()
|
t, t0 = time.time(), time.time()
|
||||||
for epoch in range(start_epoch, epochs):
|
for epoch in range(start_epoch, epochs):
|
||||||
model.train()
|
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
|
# Update scheduler
|
||||||
scheduler.step()
|
scheduler.step()
|
||||||
|
|
|
@ -199,6 +199,7 @@ class LoadImagesAndLabels(Dataset): # for training/testing
|
||||||
except:
|
except:
|
||||||
print('Warning: missing labels for %s' % self.img_files[i])
|
print('Warning: missing labels for %s' % self.img_files[i])
|
||||||
pass # missing label file
|
pass # missing label file
|
||||||
|
assert len(np.concatenate(self.labels, 0)) > 0, 'No labels found. Check label paths.'
|
||||||
|
|
||||||
def __len__(self):
|
def __len__(self):
|
||||||
return len(self.img_files)
|
return len(self.img_files)
|
||||||
|
|
Loading…
Reference in New Issue