This commit is contained in:
Glenn Jocher 2019-07-16 18:18:08 +02:00
parent 81540b80b9
commit 51d7e460a3
1 changed files with 3 additions and 2 deletions

View File

@ -170,7 +170,7 @@ def train(cfg,
t0 = time.time() t0 = time.time()
for epoch in range(start_epoch, epochs): for epoch in range(start_epoch, epochs):
model.train() model.train()
print(('\n%8s' + '%10s' * 8) % print(('\n' + '%10s' * 9) %
('Epoch', 'gpu_mem', 'GIoU/xy', 'wh', 'obj', 'cls', 'total', 'targets', 'img_size')) ('Epoch', 'gpu_mem', 'GIoU/xy', 'wh', 'obj', 'cls', 'total', 'targets', 'img_size'))
# Update scheduler # Update scheduler
@ -236,7 +236,8 @@ def train(cfg,
# Print batch results # Print batch results
mloss = (mloss * i + loss_items) / (i + 1) # update mean losses mloss = (mloss * i + loss_items) / (i + 1) # update mean losses
mem = torch.cuda.memory_cached() / 1E9 if torch.cuda.is_available() else 0 # (GB) mem = torch.cuda.memory_cached() / 1E9 if torch.cuda.is_available() else 0 # (GB)
s = ('%8s' + '%10.3g' * 8) % ('%g/%g' % (epoch, epochs - 1), mem, *mloss, len(targets), img_size) s = ('%10s' * 2 + '%10.3g' * 7) % (
'%g/%g' % (epoch, epochs - 1), '%.3gG' % mem, *mloss, len(targets), img_size)
pbar.set_description(s) # print(s) pbar.set_description(s) # print(s)
# Calculate mAP (always test final epoch, skip first 5 if opt.nosave) # Calculate mAP (always test final epoch, skip first 5 if opt.nosave)