Skip to content

Commit

Permalink
Explicitly convert artifact path to posix_path (ultralytics#3067)
Browse files Browse the repository at this point in the history
* Explicitly convert artifact path to posix_path

* Remove redudant str() casting
  • Loading branch information
AyushExel committed May 7, 2021
1 parent 86cbe66 commit 9d5914f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion utils/wandb_logging/wandb_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(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
Expand Down

0 comments on commit 9d5914f

Please sign in to comment.