added debugging util

This commit is contained in:
William Falcon
2019-07-24 10:42:01 -04:00
parent d7edaa867f
commit 60dae4d501
2 changed files with 11 additions and 7 deletions
+10 -6
View File
@@ -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)
+1 -1
View File
@@ -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',