From ebde7434b098dd2beec4d63a51ace44b7245a979 Mon Sep 17 00:00:00 2001 From: Ayush Chaurasia Date: Fri, 7 May 2021 18:43:00 +0530 Subject: [PATCH 1/2] Explicitly convert artifact path to posix_path --- utils/wandb_logging/wandb_utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils/wandb_logging/wandb_utils.py b/utils/wandb_logging/wandb_utils.py index 4a676551fdef..ac3fb59bcd30 100644 --- a/utils/wandb_logging/wandb_utils.py +++ b/utils/wandb_logging/wandb_utils.py @@ -158,7 +158,8 @@ def setup_training(self, opt, data_dict): def download_dataset_artifact(self, path, alias): if isinstance(path, str) and path.startswith(WANDB_ARTIFACT_PREFIX): - dataset_artifact = wandb.use_artifact(remove_prefix(path, WANDB_ARTIFACT_PREFIX) + ":" + alias) + artifact_path = Path(remove_prefix(path, WANDB_ARTIFACT_PREFIX) + ":" + alias) + dataset_artifact = wandb.use_artifact(str(artifact_path.as_posix())) assert dataset_artifact is not None, "'Error: W&B dataset artifact doesn\'t exist'" datadir = dataset_artifact.download() return datadir, dataset_artifact From 6c8d3b8389f0ffd605830f22cf52d5b074385c3d Mon Sep 17 00:00:00 2001 From: Ayush Chaurasia Date: Fri, 7 May 2021 16:23:59 +0530 Subject: [PATCH 2/2] Remove redudant str() casting --- utils/wandb_logging/wandb_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/wandb_logging/wandb_utils.py b/utils/wandb_logging/wandb_utils.py index ac3fb59bcd30..72a11018b429 100644 --- a/utils/wandb_logging/wandb_utils.py +++ b/utils/wandb_logging/wandb_utils.py @@ -159,7 +159,7 @@ def setup_training(self, opt, data_dict): def download_dataset_artifact(self, path, alias): if isinstance(path, str) and path.startswith(WANDB_ARTIFACT_PREFIX): artifact_path = Path(remove_prefix(path, WANDB_ARTIFACT_PREFIX) + ":" + alias) - dataset_artifact = wandb.use_artifact(str(artifact_path.as_posix())) + dataset_artifact = wandb.use_artifact(artifact_path.as_posix()) assert dataset_artifact is not None, "'Error: W&B dataset artifact doesn\'t exist'" datadir = dataset_artifact.download() return datadir, dataset_artifact