From ae0b85f2352b1baa8157d9d363fa6a42ef0fc02a Mon Sep 17 00:00:00 2001 From: William Falcon Date: Mon, 8 Jul 2019 13:01:38 -0400 Subject: [PATCH] added multi-node locked ip search --- pytorch_lightning/models/trainer.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pytorch_lightning/models/trainer.py b/pytorch_lightning/models/trainer.py index c0e8c97295..a3cc35bcf3 100644 --- a/pytorch_lightning/models/trainer.py +++ b/pytorch_lightning/models/trainer.py @@ -307,7 +307,9 @@ class Trainer(TrainerIO): my_ip = subprocess.run(['hostname', '-I'], stdout=subprocess.PIPE).stdout.decode('utf-8') my_ip = my_ip.split(' ')[0] - test_name = f'{os.getpid()}_{my_ip}' + r = np.random.uniform(0, 1, 1)[0] + + test_name = f'{os.getpid()}_{my_ip}_{r}' ip_dir = os.path.join(self.exp_save_path, '.ips', test_name) os.makedirs(ip_dir, exist_ok=True)