From 8fa9ba44e4f69f2d8a47b0a4b7702ff0abaeab9e Mon Sep 17 00:00:00 2001 From: Jim Martens Date: Wed, 1 May 2019 11:27:43 +0200 Subject: [PATCH] Improved memory usage of GPU Signed-off-by: Jim Martens --- src/twomartens/masterthesis/main.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/twomartens/masterthesis/main.py b/src/twomartens/masterthesis/main.py index 5722b29..4f3bb80 100644 --- a/src/twomartens/masterthesis/main.py +++ b/src/twomartens/masterthesis/main.py @@ -208,7 +208,10 @@ def _auto_encoder_val(args: argparse.Namespace) -> None: import tensorflow as tf from tensorflow.python.ops import summary_ops_v2 - tf.enable_eager_execution(tf.ConfigProto(log_device_placement=True)) + config = tf.ConfigProto() + config.gpu_options.allow_growth = True + config.log_device_placement = True + tf.enable_eager_execution(config=config) coco_path = args.coco_path category = args.category category_trained = args.category_trained