From 65ecf1442eef7765732b16fbbaec09fa6936cdb2 Mon Sep 17 00:00:00 2001 From: Laughing <61612323+Laughing-q@users.noreply.github.com> Date: Sat, 11 May 2024 00:20:27 +0800 Subject: [PATCH] `ultralytics 8.2.12` revert `os.sched_setaffinity()` to fix train slowdowns (#11859) Co-authored-by: Glenn Jocher --- ultralytics/__init__.py | 2 +- ultralytics/data/build.py | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/ultralytics/__init__.py b/ultralytics/__init__.py index a7fcaf75a5..45435e0431 100644 --- a/ultralytics/__init__.py +++ b/ultralytics/__init__.py @@ -1,6 +1,6 @@ # Ultralytics YOLO 🚀, AGPL-3.0 license -__version__ = "8.2.11" +__version__ = "8.2.12" from ultralytics.data.explorer.explorer import Explorer from ultralytics.models import RTDETR, SAM, YOLO, YOLOWorld diff --git a/ultralytics/data/build.py b/ultralytics/data/build.py index 157266eb3d..aab5d39bc2 100644 --- a/ultralytics/data/build.py +++ b/ultralytics/data/build.py @@ -21,7 +21,7 @@ from ultralytics.data.loaders import ( autocast_list, ) from ultralytics.data.utils import IMG_FORMATS, PIN_MEMORY, VID_FORMATS -from ultralytics.utils import LINUX, NUM_THREADS, RANK, colorstr +from ultralytics.utils import LINUX, RANK, colorstr from ultralytics.utils.checks import check_file @@ -79,8 +79,6 @@ def seed_worker(worker_id): # noqa worker_seed = torch.initial_seed() % 2**32 np.random.seed(worker_seed) random.seed(worker_seed) - if LINUX and hasattr(os, "sched_setaffinity"): # unsupported on macOS and Windows - os.sched_setaffinity(0, range(NUM_THREADS)) # fix https://github.com/ultralytics/ultralytics/pull/11195 def build_yolo_dataset(cfg, img_path, batch, data, mode="train", rect=False, stride=32, multi_modal=False):