From d09446ca68ec696cb96d0f37bf0220b7914e9350 Mon Sep 17 00:00:00 2001 From: Sean Sube Date: Fri, 17 Feb 2023 21:56:03 -0600 Subject: [PATCH] fix(api): log number of active threads when running GC (#170) --- api/onnx_web/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/onnx_web/utils.py b/api/onnx_web/utils.py index 4a412364..104cf99e 100644 --- a/api/onnx_web/utils.py +++ b/api/onnx_web/utils.py @@ -1,6 +1,7 @@ import gc from logging import getLogger from os import environ, path +import threading from typing import Any, Dict, List, Optional, Union import torch @@ -135,7 +136,7 @@ def get_size(val: Union[int, str, None]) -> SizeChart: def run_gc(devices: List[DeviceParams] = []): - logger.debug("running garbage collection") + logger.debug("running garbage collection with %s active threads", threading.active_count()) gc.collect() if torch.cuda.is_available():