This commit is contained in:
Glenn Jocher 2019-07-16 18:06:24 +02:00
parent b459587cb0
commit 81540b80b9
2 changed files with 3 additions and 3 deletions

View File

@ -171,7 +171,7 @@ def train(cfg,
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%8s' + '%10s' * 8) %
('Epoch', 'GIoU/xy', 'wh', 'obj', 'cls', 'total', 'targets', 'img_size', 'gpu_mem')) ('Epoch', 'gpu_mem', 'GIoU/xy', 'wh', 'obj', 'cls', 'total', 'targets', 'img_size'))
# Update scheduler # Update scheduler
scheduler.step() scheduler.step()
@ -236,7 +236,7 @@ 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), *mloss, len(targets), img_size, mem) s = ('%8s' + '%10.3g' * 8) % ('%g/%g' % (epoch, epochs - 1), 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)

View File

@ -685,7 +685,7 @@ def plot_results(start=0, stop=0): # from utils.utils import *; plot_results()
fig, ax = plt.subplots(2, 5, figsize=(14, 7)) fig, ax = plt.subplots(2, 5, figsize=(14, 7))
ax = ax.ravel() ax = ax.ravel()
s = ['X + Y', 'Width + Height', 'Confidence', 'Classification', 'Train Loss', 'Precision', 'Recall', 'mAP', 'F1', s = ['GIoU/XY', 'Width/Height', 'Confidence', 'Classification', 'Train Loss', 'Precision', 'Recall', 'mAP', 'F1',
'Test Loss'] 'Test Loss']
for f in sorted(glob.glob('results*.txt') + glob.glob('../../Downloads/results*.txt')): for f in sorted(glob.glob('results*.txt') + glob.glob('../../Downloads/results*.txt')):
results = np.loadtxt(f, usecols=[2, 3, 4, 5, 6, 9, 10, 11, 12, 13]).T results = np.loadtxt(f, usecols=[2, 3, 4, 5, 6, 9, 10, 11, 12, 13]).T