Centralize ENV variable definition in utils/general.py (#13004)

* 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>
This commit is contained in:
Glenn JocherandUltralyticsAssistant authored and GitHub committed 2024-05-12 22:16:54 +02:00
1 parent d1ea6b1efa
commit 28e06aa391
2 files changed
+2 -2

No files matched your search

-2
View File
@@ -48,8 +48,6 @@ import argparse
import contextlib
import json
import os
os.environ["TORCH_CPP_LOG_LEVEL"] = "ERROR"
import platform
import re
import subprocess
+2
View File
@@ -68,6 +68,8 @@ cv2.setNumThreads(0) # prevent OpenCV from multithreading (incompatible with Py
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=""):