From cade5dda730877337219b3cb5889b3fddf12233f Mon Sep 17 00:00:00 2001 From: Robert Sachunsky Date: Tue, 14 Feb 2023 23:09:40 +0000 Subject: [PATCH] reintroduce TF stderr / log silencer --- sbb_binarize/sbb_binarize.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sbb_binarize/sbb_binarize.py b/sbb_binarize/sbb_binarize.py index b65c50b..fa42223 100644 --- a/sbb_binarize/sbb_binarize.py +++ b/sbb_binarize/sbb_binarize.py @@ -3,15 +3,22 @@ import gc import itertools import math import os +import sys from pathlib import Path from typing import Union, List, Any import cv2 import numpy as np + +os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' +stderr = sys.stderr +sys.stderr = open(os.devnull, 'w') import tensorflow as tf +from tensorflow.python.keras.saving.save import load_model +sys.stderr = stderr + from mpire import WorkerPool from mpire.utils import make_single_arguments -from tensorflow.python.keras.saving.save import load_model class SbbBinarizer: