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