From 4c2033d7c3ae2704e18a074a0acae081f19aab19 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Sun, 18 Jun 2023 16:09:46 +0200 Subject: [PATCH] Uninstall `wandb` from notebook environments (#3247) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- ultralytics/yolo/utils/checks.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ultralytics/yolo/utils/checks.py b/ultralytics/yolo/utils/checks.py index eb30da1..a2d571f 100644 --- a/ultralytics/yolo/utils/checks.py +++ b/ultralytics/yolo/utils/checks.py @@ -20,8 +20,8 @@ import torch from matplotlib import font_manager from ultralytics.yolo.utils import (AUTOINSTALL, LOGGER, ONLINE, ROOT, USER_CONFIG_DIR, TryExcept, clean_url, colorstr, - downloads, emojis, is_colab, is_docker, is_kaggle, is_online, is_pip_package, - url2file) + downloads, emojis, is_colab, is_docker, is_jupyter, is_kaggle, is_online, + is_pip_package, url2file) def is_ascii(s) -> bool: @@ -325,8 +325,11 @@ def check_yolo(verbose=True, device=''): """Return a human-readable YOLO software and hardware summary.""" from ultralytics.yolo.utils.torch_utils import select_device - if is_colab(): - shutil.rmtree('sample_data', ignore_errors=True) # remove colab /sample_data directory + if is_jupyter(): + if check_requirements('wandb', install=False): + os.system('pip uninstall -y wandb') # uninstall wandb: unwanted account creation prompt with infinite hang + if is_colab(): + shutil.rmtree('sample_data', ignore_errors=True) # remove colab /sample_data directory if verbose: # System info