Repository: graphnet-team/graphnet
Issue: Running train_model from examples after install needs directory "wandb"

After installing graphnet from scratch and signing up to WandB, running train_model from examples yields the following error:

```
(graphnet) [peter@hep04 examples]$ python train_model.py 
graphnet: INFO     2022-08-30 12:21:56 - get_logger - Writing log to logs/graphnet_20220830-122156.log
graphnet: WARNING  2022-08-30 12:21:56 - <module> - icecube package not available.
graphnet: WARNING  2022-08-30 12:21:56 - <module> - icecube package not available.
graphnet: WARNING  2022-08-30 12:21:56 - <module> - icecube package not available.
graphnet: WARNING  2022-08-30 12:21:56 - <module> - icecube package not available.
wandb: Currently logged in as: peterandresen (graphnet-team). Use `wandb login --relogin` to force relogin
wandb: WARNING Path ./wandb/wandb/ wasn't writable, using system temp directory.
Traceback (most recent call last):
  File "/groups/icecube/peter/anaconda3/envs/graphnet/lib/python3.8/site-packages/wandb/sdk/wandb_init.py", line 1040, in init
    wi.setup(kwargs)
  File "/groups/icecube/peter/anaconda3/envs/graphnet/lib/python3.8/site-packages/wandb/sdk/wandb_init.py", line 287, in setup
    self._log_setup(settings)
  File "/groups/icecube/peter/anaconda3/envs/graphnet/lib/python3.8/site-packages/wandb/sdk/wandb_init.py", line 431, in _log_setup
    filesystem._safe_makedirs(os.path.dirname(settings.log_user))
  File "/groups/icecube/peter/anaconda3/envs/graphnet/lib/python3.8/site-packages/wandb/sdk/lib/filesystem.py", line 10, in _safe_makedirs
    os.makedirs(dir_name)
  File "/groups/icecube/peter/anaconda3/envs/graphnet/lib/python3.8/os.py", line 213, in makedirs
    makedirs(head, exist_ok=exist_ok)
  File "/groups/icecube/peter/anaconda3/envs/graphnet/lib/python3.8/os.py", line 223, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/tmp/wandb/run-20220830_122200-1qc85fm4'
wandb: ERROR Abnormal program exit
Traceback (most recent call last):
  File "/groups/icecube/peter/anaconda3/envs/graphnet/lib/python3.8/site-packages/wandb/sdk/wandb_init.py", line 1040, in init
    wi.setup(kwargs)
  File "/groups/icecube/peter/anaconda3/envs/graphnet/lib/python3.8/site-packages/wandb/sdk/wandb_init.py", line 287, in setup
    self._log_setup(settings)
  File "/groups/icecube/peter/anaconda3/envs/graphnet/lib/python3.8/site-packages/wandb/sdk/wandb_init.py", line 431, in _log_setup
    filesystem._safe_makedirs(os.path.dirname(settings.log_user))
  File "/groups/icecube/peter/anaconda3/envs/graphnet/lib/python3.8/site-packages/wandb/sdk/lib/filesystem.py", line 10, in _safe_makedirs
    os.makedirs(dir_name)
  File "/groups/icecube/peter/anaconda3/envs/graphnet/lib/python3.8/os.py", line 213, in makedirs
    makedirs(head, exist_ok=exist_ok)
  File "/groups/icecube/peter/anaconda3/envs/graphnet/lib/python3.8/os.py", line 223, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/tmp/wandb/run-20220830_122200-1qc85fm4'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "train_model.py", line 37, in <module>
    wandb_logger = WandbLogger(
  File "/groups/icecube/peter/anaconda3/envs/graphnet/lib/python3.8/site-packages/pytorch_lightning/loggers/wandb.py", line 315, in __init__
    _ = self.experiment
  File "/groups/icecube/peter/anaconda3/envs/graphnet/lib/python3.8/site-packages/pytorch_lightning/loggers/logger.py", line 54, in experiment
    return get_experiment() or DummyExperiment()
  File "/groups/icecube/peter/anaconda3/envs/graphnet/lib/python3.8/site-packages/pytorch_lightning/utilities/rank_zero.py", line 32, in wrapped_fn
    return fn(*args, **kwargs)
  File "/groups/icecube/peter/anaconda3/envs/graphnet/lib/python3.8/site-packages/pytorch_lightning/loggers/logger.py", line 52, in get_experiment
    return fn(self)
  File "/groups/icecube/peter/anaconda3/envs/graphnet/lib/python3.8/site-packages/pytorch_lightning/loggers/wandb.py", line 361, in experiment
    self._experiment = wandb.init(**self._wandb_init)
  File "/groups/icecube/peter/anaconda3/envs/graphnet/lib/python3.8/site-packages/wandb/sdk/wandb_init.py", line 1081, in init
    raise Exception("problem") from error_seen
Exception: problem
```

Which can be fixed by creating a folder called "wandb" in the place where you are running the file from. Would it make sense to automatically create such a folder, if it is not already present?

Changed files:
examples/train_model.py

diff --git a/examples/train_model.py b/examples/train_model.py
index 67779e30..f2a0f417 100644
--- a/examples/train_model.py
+++ b/examples/train_model.py
@@ -1,4 +1,4 @@
-import os.path
+import os
 
 from pytorch_lightning import Trainer
 from pytorch_lightning.callbacks import EarlyStopping
@@ -33,11 +33,15 @@ torch.multiprocessing.set_sharing_strategy("file_system")
 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,
 )