From b18ca31ff5412d30ee56eb9c4adbe731f9d2148e Mon Sep 17 00:00:00 2001 From: Ayush Chaurasia Date: Wed, 5 May 2021 17:58:19 +0530 Subject: [PATCH] use check_file for --data (#3035) --- utils/wandb_logging/wandb_utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/utils/wandb_logging/wandb_utils.py b/utils/wandb_logging/wandb_utils.py index 928f577fd460..4a676551fdef 100644 --- a/utils/wandb_logging/wandb_utils.py +++ b/utils/wandb_logging/wandb_utils.py @@ -9,7 +9,7 @@ sys.path.append(str(Path(__file__).parent.parent.parent)) # add utils/ to path from utils.datasets import LoadImagesAndLabels from utils.datasets import img2label_paths -from utils.general import colorstr, xywh2xyxy, check_dataset +from utils.general import colorstr, xywh2xyxy, check_dataset, check_file try: import wandb @@ -54,7 +54,7 @@ def check_wandb_resume(opt): def process_wandb_config_ddp_mode(opt): - with open(opt.data) as f: + with open(check_file(opt.data)) as f: data_dict = yaml.safe_load(f) # data dict train_dir, val_dir = None, None if isinstance(data_dict['train'], str) and data_dict['train'].startswith(WANDB_ARTIFACT_PREFIX): @@ -115,7 +115,7 @@ def __init__(self, opt, name, run_id, data_dict, job_type='Training'): def check_and_upload_dataset(self, opt): assert wandb, 'Install wandb to upload dataset' check_dataset(self.data_dict) - config_path = self.log_dataset_artifact(opt.data, + config_path = self.log_dataset_artifact(check_file(opt.data), opt.single_cls, 'YOLOv5' if opt.project == 'runs/train' else Path(opt.project).stem) print("Created dataset config file ", config_path)