Skip to content

Commit

Permalink
Fix YOLOv8 validation when custom dataset yaml is provided (#1528)
Browse files Browse the repository at this point in the history
* Fix type of data path for the case where a complete path to a yaml file is used

* Style fixes
  • Loading branch information
anmarques committed Apr 20, 2023
1 parent 53d67b2 commit ad82f3b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/sparseml/yolov8/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import json
from argparse import Namespace
from pathlib import Path

import torch
from tqdm import tqdm
Expand Down Expand Up @@ -87,6 +88,8 @@ def __call__(self, trainer=None, model=None, training=True):
raise FileNotFoundError(
emojis(f"Dataset '{self.args.data}' not found ❌")
)
if isinstance(self.data["path"], str):
self.data["path"] = Path(self.data["path"])

if self.device.type == "cpu":
self.args.workers = (
Expand Down

0 comments on commit ad82f3b

Please sign in to comment.