Respect ENV value for `OMP_NUM_THREADS` if set (#16751)

Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
pull/16782/head^2
Burhan 2 months ago committed by GitHub
parent 67683a87f1
commit 1e6c454460
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 5
      ultralytics/__init__.py

@ -4,8 +4,9 @@ __version__ = "8.3.7"
import os
# Set ENV Variables (place before imports)
os.environ["OMP_NUM_THREADS"] = "1" # reduce CPU utilization during training
# Set ENV variables (place before imports)
if not os.environ.get("OMP_NUM_THREADS"):
os.environ["OMP_NUM_THREADS"] = "1" # default for reduced CPU utilization during training
from ultralytics.data.explorer.explorer import Explorer
from ultralytics.models import NAS, RTDETR, SAM, YOLO, FastSAM, YOLOWorld

Loading…
Cancel
Save