Skip to content

Commit ea8fb86

Browse files
glenn-jocherClay Januhowski
authored andcommitted
Fix OMP_NUM_THREADS=1 for macOS (ultralytics#8624)
Resolves ultralytics#8623
1 parent b8f23a2 commit ea8fb86

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

utils/general.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
pd.options.display.max_columns = 10
5353
cv2.setNumThreads(0) # prevent OpenCV from multithreading (incompatible with PyTorch DataLoader)
5454
os.environ['NUMEXPR_MAX_THREADS'] = str(NUM_THREADS) # NumExpr max threads
55-
os.environ['OMP_NUM_THREADS'] = str(NUM_THREADS) # OpenMP max threads (PyTorch and SciPy)
55+
os.environ['OMP_NUM_THREADS'] = '1' if platform.system() == 'darwin' else str(NUM_THREADS) # OpenMP (PyTorch and SciPy)
5656

5757

5858
def is_kaggle():

0 commit comments

Comments
 (0)