From 16c5032735996a2026d20a88cb6cc2643435851f Mon Sep 17 00:00:00 2001 From: Gal Leibovich Date: Sat, 17 Feb 2018 12:42:59 +0200 Subject: [PATCH] fix for tensorboard visualization slowing execution even when it is off apparently tensorflow still collect summary data even when no summary FileWriter is defined. --- architectures/tensorflow_components/architecture.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/architectures/tensorflow_components/architecture.py b/architectures/tensorflow_components/architecture.py index 64d802c..6a36bb8 100644 --- a/architectures/tensorflow_components/architecture.py +++ b/architectures/tensorflow_components/architecture.py @@ -90,7 +90,8 @@ class TensorFlowArchitecture(Architecture): for idx, var in enumerate(self.trainable_weights): placeholder = tf.placeholder(tf.float32, shape=var.get_shape(), name=str(idx) + '_holder') self.weights_placeholders.append(placeholder) - variable_summaries(var) + if self.tp.visualization.tensorboard: + variable_summaries(var) self.update_weights_from_list = [weights.assign(holder) for holder, weights in zip(self.weights_placeholders, self.trainable_weights)]