`ultralytics 8.0.109` HUB training fix (#2818)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
single_channel
Glenn Jocher 2 years ago committed by GitHub
parent ffc0e8ccf7
commit f23a03596d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -29,7 +29,7 @@ def test_special_modes():
@pytest.mark.parametrize('task,model,data', TASK_ARGS) @pytest.mark.parametrize('task,model,data', TASK_ARGS)
def test_train(task, model, data): def test_train(task, model, data):
run(f'yolo train {task} model={model}.yaml data={data} imgsz=32 epochs=1') run(f'yolo train {task} model={model}.yaml data={data} imgsz=32 epochs=1 cache=disk')
@pytest.mark.parametrize('task,model,data', TASK_ARGS) @pytest.mark.parametrize('task,model,data', TASK_ARGS)

@ -108,13 +108,13 @@ def test_amp():
def test_train_scratch(): def test_train_scratch():
model = YOLO(CFG) model = YOLO(CFG)
model.train(data='coco8.yaml', epochs=1, imgsz=32) model.train(data='coco8.yaml', epochs=1, imgsz=32, cache='disk') # test disk caching
model(SOURCE) model(SOURCE)
def test_train_pretrained(): def test_train_pretrained():
model = YOLO(MODEL) model = YOLO(MODEL)
model.train(data='coco8.yaml', epochs=1, imgsz=32) model.train(data='coco8.yaml', epochs=1, imgsz=32, cache='ram') # test RAM caching
model(SOURCE) model(SOURCE)

@ -1,6 +1,6 @@
# Ultralytics YOLO 🚀, AGPL-3.0 license # Ultralytics YOLO 🚀, AGPL-3.0 license
__version__ = '8.0.108' __version__ = '8.0.109'
from ultralytics.hub import start from ultralytics.hub import start
from ultralytics.vit.rtdetr import RTDETR from ultralytics.vit.rtdetr import RTDETR

@ -54,7 +54,7 @@ class BaseDataset(Dataset):
hyp=DEFAULT_CFG, hyp=DEFAULT_CFG,
prefix='', prefix='',
rect=False, rect=False,
batch_size=None, batch_size=16,
stride=32, stride=32,
pad=0.5, pad=0.5,
single_cls=False, single_cls=False,
@ -77,6 +77,10 @@ class BaseDataset(Dataset):
assert self.batch_size is not None assert self.batch_size is not None
self.set_rectangle() self.set_rectangle()
# Buffer thread for mosaic images
self.buffer = [] # buffer size = batch size
self.max_buffer_length = min((self.ni, self.batch_size * 8, 1000)) if self.augment else 0
# Cache stuff # Cache stuff
if cache == 'ram' and not self.check_cache_ram(): if cache == 'ram' and not self.check_cache_ram():
cache = False cache = False
@ -88,10 +92,6 @@ class BaseDataset(Dataset):
# Transforms # Transforms
self.transforms = self.build_transforms(hyp=hyp) self.transforms = self.build_transforms(hyp=hyp)
# Buffer thread for mosaic images
self.buffer = [] # buffer size = batch size
self.max_buffer_length = min((self.ni, self.batch_size * 8, 1000)) if self.augment else 0
def get_img_files(self, img_path): def get_img_files(self, img_path):
"""Read image files.""" """Read image files."""
try: try:

Loading…
Cancel
Save