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