From b454ad295eb3024a238d32bf2aef1ebc3c496b44 Mon Sep 17 00:00:00 2001 From: Scott Date: Tue, 11 Jan 2022 13:33:24 -0800 Subject: Start using warnings from stdlib. --- ml/quick_label.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'ml/quick_label.py') diff --git a/ml/quick_label.py b/ml/quick_label.py index 1ed4296..120ff5f 100644 --- a/ml/quick_label.py +++ b/ml/quick_label.py @@ -4,6 +4,7 @@ import glob import logging import os from typing import Callable, List, NamedTuple, Optional, Set +import warnings import argparse_utils import config @@ -90,9 +91,9 @@ def label(in_spec: InputSpec) -> None: continue features = in_spec.image_file_to_features_file(image) if features is None or not os.path.exists(features): - logger.warning( - f'File {image} yielded file {features} which does not exist, SKIPPING.' - ) + msg = f'File {image} yielded file {features} which does not exist, SKIPPING.' + logger.warning(msg) + warnings.warn(msg) continue # Render features and image. -- cgit v1.3