|
|
@ -8,7 +8,7 @@ from copy import deepcopy
|
|
|
|
import numpy as np
|
|
|
|
import numpy as np
|
|
|
|
import torch
|
|
|
|
import torch
|
|
|
|
|
|
|
|
|
|
|
|
from ultralytics.yolo.utils import LOGGER, colorstr
|
|
|
|
from ultralytics.yolo.utils import DEFAULT_CFG, LOGGER, colorstr
|
|
|
|
from ultralytics.yolo.utils.torch_utils import profile
|
|
|
|
from ultralytics.yolo.utils.torch_utils import profile
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -29,7 +29,7 @@ def check_train_batch_size(model, imgsz=640, amp=True):
|
|
|
|
return autobatch(deepcopy(model).train(), imgsz) # compute optimal batch size
|
|
|
|
return autobatch(deepcopy(model).train(), imgsz) # compute optimal batch size
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def autobatch(model, imgsz=640, fraction=0.67, batch_size=16):
|
|
|
|
def autobatch(model, imgsz=640, fraction=0.67, batch_size=DEFAULT_CFG.batch):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
Automatically estimate the best YOLO batch size to use a fraction of the available CUDA memory.
|
|
|
|
Automatically estimate the best YOLO batch size to use a fraction of the available CUDA memory.
|
|
|
|
|
|
|
|
|
|
|
|