Skip to content

Commit

Permalink
Merge pull request #276 from asogaard/wandb-custom-dir
Browse files Browse the repository at this point in the history
Create W&B directory if it doesn't exist
  • Loading branch information
Peterandresen12 authored Aug 31, 2022
2 parents 2671f2d + 088632e commit 97110e0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions examples/train_model.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import os.path
import os

from pytorch_lightning import Trainer
from pytorch_lightning.callbacks import EarlyStopping
Expand Down Expand Up @@ -33,11 +33,15 @@
features = FEATURES.DEEPCORE
truth = TRUTH.DEEPCORE[:-1]

# Make sure W&B output directory exists
WANDB_DIR = "./wandb/"
os.makedirs(WANDB_DIR, exist_ok=True)

# Initialise Weights & Biases (W&B) run
wandb_logger = WandbLogger(
project="example-script",
entity="graphnet-team",
save_dir="./wandb/",
save_dir=WANDB_DIR,
log_model=True,
)

Expand Down

0 comments on commit 97110e0

Please sign in to comment.