glenn-jocher commited on
Commit
60e42e1
·
unverified ·
1 Parent(s): 3364379

Update autobatch.py (#5536)

Browse files
Files changed (1) hide show
  1. utils/autobatch.py +1 -1
utils/autobatch.py CHANGED
@@ -52,5 +52,5 @@ def autobatch(model, imgsz=640, fraction=0.9, batch_size=16):
52
  batch_sizes = batch_sizes[:len(y)]
53
  p = np.polyfit(batch_sizes, y, deg=1) # first degree polynomial fit
54
  b = int((f * fraction - p[1]) / p[0]) # y intercept (optimal batch size)
55
- print(f'{prefix}Using colorstr(batch-size {b}) for {d} {t * fraction:.3g}G/{t:.3g}G ({fraction * 100:.0f}%)')
56
  return b
 
52
  batch_sizes = batch_sizes[:len(y)]
53
  p = np.polyfit(batch_sizes, y, deg=1) # first degree polynomial fit
54
  b = int((f * fraction - p[1]) / p[0]) # y intercept (optimal batch size)
55
+ print(f'{prefix}Using batch-size {b} for {d} {t * fraction:.3g}G/{t:.3g}G ({fraction * 100:.0f}%)')
56
  return b