From 6dc83dd1a51ed9590fcfcb50e179f916306a7742 Mon Sep 17 00:00:00 2001 From: Robert Sachunsky Date: Tue, 14 Feb 2023 23:34:27 +0000 Subject: [PATCH] comment out explicit GC calls / session management --- sbb_binarize/sbb_binarize.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbb_binarize/sbb_binarize.py b/sbb_binarize/sbb_binarize.py index 4d12e19..81aeca3 100644 --- a/sbb_binarize/sbb_binarize.py +++ b/sbb_binarize/sbb_binarize.py @@ -87,8 +87,8 @@ class SbbBinarizer: predicted_patches = model.predict(image_patches, verbose=0) # We have to manually call garbage collection and clear_session here to avoid memory leaks. # Taken from https://medium.com/dive-into-ml-ai/dealing-with-memory-leak-issue-in-keras-model-training-e703907a6501 - gc.collect() - tf.keras.backend.clear_session() + #gc.collect() + #tf.keras.backend.clear_session() # The result is a white-on-black image that needs to be inverted to be displayed as black-on-white image # We do this by converting the binary values to a boolean numpy-array and then inverting the values