From 4174db9a12e336db3d224ca7575667f209868265 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Sun, 18 Jun 2023 16:09:41 +0200 Subject: [PATCH] Uninstall `wandb` from notebook environments (#11730) * Uninstall `wandb` from notebook environments Due to undesired behavior in https://www.kaggle.com/code/ultralytics/yolov8/comments#2306977 Signed-off-by: Glenn Jocher * fix import * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Signed-off-by: Glenn Jocher Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- utils/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/utils/__init__.py b/utils/__init__.py index 4687889bfc56..2a7652b52c1b 100644 --- a/utils/__init__.py +++ b/utils/__init__.py @@ -54,6 +54,8 @@ def notebook_init(verbose=True): import os import shutil + from ultralytics.yolo.utils.checks import check_requirements + from utils.general import check_font, is_colab from utils.torch_utils import select_device # imports @@ -61,7 +63,8 @@ def notebook_init(verbose=True): import psutil - os.system('pip uninstall -y wandb') + if check_requirements('wandb', install=False): + os.system('pip uninstall -y wandb') # eliminate unexpected account creation prompt with infinite hang if is_colab(): shutil.rmtree('/content/sample_data', ignore_errors=True) # remove colab /sample_data directory