Skip to content

Commit

Permalink
use check_file for --data (ultralytics#3035)
Browse files Browse the repository at this point in the history
(cherry picked from commit b18ca31)
  • Loading branch information
AyushExel authored and Lechtr committed May 24, 2021
1 parent e04361e commit b54a771
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions utils/wandb_logging/wandb_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -116,7 +116,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)
Expand Down

0 comments on commit b54a771

Please sign in to comment.