Skip to content

Commit

Permalink
Centralize ENV variable definition in utils/general.py (#13004)
Browse files Browse the repository at this point in the history
* Centralize ENV variable definition in utils/general.py

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* Update export.py

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* Auto-format by https://ultralytics.com/actions

---------

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
  • Loading branch information
glenn-jocher and UltralyticsAssistant committed May 12, 2024
1 parent d1ea6b1 commit 28e06aa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 0 additions & 2 deletions export.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@
import contextlib
import json
import os

os.environ["TORCH_CPP_LOG_LEVEL"] = "ERROR"
import platform
import re
import subprocess
Expand Down
2 changes: 2 additions & 0 deletions utils/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@
os.environ["NUMEXPR_MAX_THREADS"] = str(NUM_THREADS) # NumExpr max threads
os.environ["OMP_NUM_THREADS"] = "1" if platform.system() == "darwin" else str(NUM_THREADS) # OpenMP (PyTorch and SciPy)
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "2" # suppress verbose TF compiler warnings in Colab
os.environ["TORCH_CPP_LOG_LEVEL"] = "ERROR" # suppress "NNPACK.cpp could not initialize NNPACK" warnings
os.environ["KINETO_LOG_LEVEL"] = "5" # suppress verbose PyTorch profiler output when computing FLOPs


def is_ascii(s=""):
Expand Down

0 comments on commit 28e06aa

Please sign in to comment.