From 60dae4d50108d9f83ffb9e0cf8c8b723266bbb2a Mon Sep 17 00:00:00 2001 From: William Falcon Date: Wed, 24 Jul 2019 10:42:01 -0400 Subject: [PATCH] added debugging util --- pytorch_lightning/models/trainer.py | 16 ++++++++++------ tests/debug.py | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/pytorch_lightning/models/trainer.py b/pytorch_lightning/models/trainer.py index 9cdbd7c2..6aa2ab54 100644 --- a/pytorch_lightning/models/trainer.py +++ b/pytorch_lightning/models/trainer.py @@ -150,6 +150,16 @@ class Trainer(TrainerIO): self.use_ddp = False self.use_dp = False + # training bookeeping + self.total_batch_nb = 0 + self.running_loss = [] + self.avg_loss = 0 + self.batch_nb = 0 + self.tqdm_metrics = {} + self.nb_val_batches = None + self.nb_tng_batches = None + self.nb_test_batches = None + # gpus come in as a string. # if gpus = -1 then use all available devices # otherwise, split the string using commas @@ -273,12 +283,6 @@ class Trainer(TrainerIO): return self.__tng_tqdm_dic def __layout_bookeeping(self): - # training bookeeping - self.total_batch_nb = 0 - self.running_loss = [] - self.avg_loss = 0 - self.batch_nb = 0 - self.tqdm_metrics = {} # determine number of training batches self.nb_tng_batches = len(self.tng_dataloader) diff --git a/tests/debug.py b/tests/debug.py index 34da26ed..3f0c58f0 100644 --- a/tests/debug.py +++ b/tests/debug.py @@ -50,7 +50,7 @@ def main(): progress_bar=False, experiment=get_exp(), max_nb_epochs=1, - train_percent_check=1.0, + train_percent_check=0.4, val_percent_check=0.4, gpus=[0, 1], distributed_backend='ddp',