From 493a98d59145303acf975ab9c627c6d8927b59b0 Mon Sep 17 00:00:00 2001 From: William Falcon Date: Mon, 8 Jul 2019 18:28:30 -0400 Subject: [PATCH] moved sampler --- examples/new_project_templates/lightning_module_template.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/new_project_templates/lightning_module_template.py b/examples/new_project_templates/lightning_module_template.py index 4d6a402f33..30db6f06d4 100644 --- a/examples/new_project_templates/lightning_module_template.py +++ b/examples/new_project_templates/lightning_module_template.py @@ -161,8 +161,10 @@ class LightningTemplateModel(LightningModule): # when using multi-node we need to add the datasampler try: if self.hparams.nb_gpu_nodes > 1: + print('-'*100) + print(self.trainer.world_size, self.trainer.proc_rank) + print('-'*100) train_sampler = DistributedSampler(dataset, num_replicas=self.trainer.world_size, rank=self.trainer.proc_rank) - print('using sampler') except Exception as e: print('no sampler') train_sampler = None