Browse Source

Update autobatch.py (#5536)

modifyDataloader
Glenn Jocher GitHub 2 years ago
parent
commit
60e42e16c2
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      utils/autobatch.py

+ 1
- 1
utils/autobatch.py View File

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

Loading…
Cancel
Save