From f34cb146e0d0e61736ecce400ce40db224aedc7b Mon Sep 17 00:00:00 2001 From: Andre Anjos <andre.dos.anjos@gmail.com> Date: Tue, 12 May 2020 18:46:53 +0200 Subject: [PATCH] [engine.trainer] Black formatting --- bob/ip/binseg/engine/trainer.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bob/ip/binseg/engine/trainer.py b/bob/ip/binseg/engine/trainer.py index 00f93182..81b191dd 100644 --- a/bob/ip/binseg/engine/trainer.py +++ b/bob/ip/binseg/engine/trainer.py @@ -45,7 +45,7 @@ def run( ---------- model : :py:class:`torch.nn.Module` - Network (e.g. DRIU, HED, UNet) + Network (e.g. driu, hed, unet) data_loader : :py:class:`torch.utils.data.DataLoader` @@ -142,6 +142,7 @@ def run( for k, v in state.items(): if isinstance(v, torch.Tensor): state[k] = v.to(device) + # Total training timer start_training_time = time.time() @@ -209,7 +210,7 @@ def run( ("median_loss", f"{losses.median:.6f}"), ("learning_rate", f"{optimizer.param_groups[0]['lr']:.6f}"), ) + cpu_log() - if device != 'cpu': + if device != "cpu": logdata += gpu_log() logwriter.writerow(dict(k for k in logdata)) -- GitLab