Skip to content

Commit

Permalink
Fix OMP_NUM_THREADS=1 for macOS (#8624)
Browse files Browse the repository at this point in the history
Resolves #8623
  • Loading branch information
glenn-jocher committed Jul 18, 2022
1 parent 9cf5fd5 commit fbe67e4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
pd.options.display.max_columns = 10
cv2.setNumThreads(0) # prevent OpenCV from multithreading (incompatible with PyTorch DataLoader)
os.environ['NUMEXPR_MAX_THREADS'] = str(NUM_THREADS) # NumExpr max threads
os.environ['OMP_NUM_THREADS'] = str(NUM_THREADS) # OpenMP max threads (PyTorch and SciPy)
os.environ['OMP_NUM_THREADS'] = '1' if platform.system() == 'darwin' else str(NUM_THREADS) # OpenMP (PyTorch and SciPy)


def is_kaggle():
Expand Down

0 comments on commit fbe67e4

Please sign in to comment.