Skip to content

Commit 9b79d27

Browse files
committed
.
1 parent bc52689 commit 9b79d27

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pytorch_lightning/trainer/properties.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,10 @@ def is_global_zero(self) -> bool:
120120
def slurm_job_id(self) -> Optional[int]:
121121
job_id = os.environ.get('SLURM_JOB_ID')
122122
if job_id:
123-
job_id = int(job_id)
123+
try:
124+
job_id = int(job_id)
125+
except ValueError:
126+
job_id = None
124127

125128
# in interactive mode, don't make logs use the same job id
126129
in_slurm_interactive_mode = os.environ.get('SLURM_JOB_NAME') == 'bash'

0 commit comments

Comments
 (0)