diff --git a/pytorch_lightning/models/trainer.py b/pytorch_lightning/models/trainer.py index eb80300f..82a24e9e 100644 --- a/pytorch_lightning/models/trainer.py +++ b/pytorch_lightning/models/trainer.py @@ -380,7 +380,7 @@ class Trainer(TrainerIO): :return: """ try: - os.environ['MASTER_PORT'] + port = os.environ['MASTER_PORT'] except Exception as e: port = 12910 os.environ['MASTER_PORT'] = f'{port}'