diff --git a/yolo/tools/solver.py b/yolo/tools/solver.py index 51ceffc0..68bbf181 100644 --- a/yolo/tools/solver.py +++ b/yolo/tools/solver.py @@ -228,8 +228,8 @@ def __init__( with contextlib.redirect_stdout(io.StringIO()): # TODO: load with config file - json_path, _ = locate_label_paths(Path(dataset_cfg.path), dataset_cfg.get("validation", "val")) - if json_path: + json_path, file_type = locate_label_paths(Path(dataset_cfg.path), dataset_cfg.get("validation", "val")) + if json_path and file_type == "json": self.coco_gt = COCO(json_path) def solve(self, dataloader, epoch_idx=1):