updates
This commit is contained in:
		
							parent
							
								
									b459587cb0
								
							
						
					
					
						commit
						81540b80b9
					
				
							
								
								
									
										4
									
								
								train.py
								
								
								
								
							
							
						
						
									
										4
									
								
								train.py
								
								
								
								
							| 
						 | 
				
			
			@ -171,7 +171,7 @@ def train(cfg,
 | 
			
		|||
    for epoch in range(start_epoch, epochs):
 | 
			
		||||
        model.train()
 | 
			
		||||
        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
 | 
			
		||||
        scheduler.step()
 | 
			
		||||
| 
						 | 
				
			
			@ -236,7 +236,7 @@ def train(cfg,
 | 
			
		|||
            # Print batch results
 | 
			
		||||
            mloss = (mloss * i + loss_items) / (i + 1)  # update mean losses
 | 
			
		||||
            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)
 | 
			
		||||
 | 
			
		||||
        # Calculate mAP (always test final epoch, skip first 5 if opt.nosave)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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))
 | 
			
		||||
    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']
 | 
			
		||||
    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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue