summaryrefslogtreecommitdiff
path: root/training/callbacks/wandb_callbacks.py
diff options
context:
space:
mode:
authorGustaf Rydholm <gustaf.rydholm@gmail.com>2021-08-06 02:42:45 +0200
committerGustaf Rydholm <gustaf.rydholm@gmail.com>2021-08-06 02:42:45 +0200
commit3ab82ad36bce6fa698a13a029a0694b75a5947b7 (patch)
tree136f71a62d60e3ccf01e1f95d64bb4d9f9c9befe /training/callbacks/wandb_callbacks.py
parent1bccf71cf4eec335001b50a8fbc0c991d0e6d13a (diff)
Fix VQVAE into en/decoder, bug in wandb artifact code uploading
Diffstat (limited to 'training/callbacks/wandb_callbacks.py')
-rw-r--r--training/callbacks/wandb_callbacks.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/training/callbacks/wandb_callbacks.py b/training/callbacks/wandb_callbacks.py
index 61d71df..2264750 100644
--- a/training/callbacks/wandb_callbacks.py
+++ b/training/callbacks/wandb_callbacks.py
@@ -39,8 +39,8 @@ class WatchModel(Callback):
class UploadCodeAsArtifact(Callback):
"""Upload all *.py files to W&B as an artifact, at the beginning of the run."""
- def __init__(self, project_dir: str) -> None:
- self.project_dir = Path(project_dir)
+ def __init__(self) -> None:
+ self.project_dir = Path(__file__).resolve().parents[2] / "text_recognizer"
@rank_zero_only
def on_train_start(self, trainer: Trainer, pl_module: LightningModule) -> None:
@@ -49,7 +49,7 @@ class UploadCodeAsArtifact(Callback):
experiment = logger.experiment
artifact = wandb.Artifact("project-source", type="code")
for filepath in self.project_dir.glob("**/*.py"):
- artifact.add_file(filepath)
+ artifact.add_file(str(filepath))
experiment.use_artifact(artifact)
@@ -60,7 +60,7 @@ class UploadCheckpointsAsArtifact(Callback):
def __init__(
self, ckpt_dir: str = "checkpoints/", upload_best_only: bool = False
) -> None:
- self.ckpt_dir = ckpt_dir
+ self.ckpt_dir = Path(__file__).resolve().parent / ckpt_dir
self.upload_best_only = upload_best_only
@rank_zero_only