Skip to content

Commit 97110e0

Browse files
Merge pull request #276 from asogaard/wandb-custom-dir
Create W&B directory if it doesn't exist
2 parents 2671f2d + 088632e commit 97110e0

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

examples/train_model.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import os.path
1+
import os
22

33
from pytorch_lightning import Trainer
44
from pytorch_lightning.callbacks import EarlyStopping
@@ -33,11 +33,15 @@
3333
features = FEATURES.DEEPCORE
3434
truth = TRUTH.DEEPCORE[:-1]
3535

36+
# Make sure W&B output directory exists
37+
WANDB_DIR = "./wandb/"
38+
os.makedirs(WANDB_DIR, exist_ok=True)
39+
3640
# Initialise Weights & Biases (W&B) run
3741
wandb_logger = WandbLogger(
3842
project="example-script",
3943
entity="graphnet-team",
40-
save_dir="./wandb/",
44+
save_dir=WANDB_DIR,
4145
log_model=True,
4246
)
4347

0 commit comments

Comments
 (0)