From 58cc6e13b9999161a526b83063c983750e6553b1 Mon Sep 17 00:00:00 2001 From: ctlaltdefeat Date: Sat, 7 Dec 2019 17:12:33 +0200 Subject: [PATCH] Update logging.py (#602) --- pytorch_lightning/trainer/logging.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pytorch_lightning/trainer/logging.py b/pytorch_lightning/trainer/logging.py index 9dfb41f12f..8a178917a3 100644 --- a/pytorch_lightning/trainer/logging.py +++ b/pytorch_lightning/trainer/logging.py @@ -87,7 +87,8 @@ class TrainerLoggingMixin(ABC): callback_metrics = self.reduce_distributed_output(callback_metrics, num_gpus) for k, v in callback_metrics.items(): - callback_metrics[k] = v.item() + if isinstance(v, torch.Tensor): + callback_metrics[k] = v.item() # --------------- # EXTRACT PROGRESS BAR KEYS