Skip to content

Commit

Permalink
Use DatasetNotFoundError in coco importer (#24)
Browse files Browse the repository at this point in the history
Co-authored-by: Maxim Zhiltsov <zhiltsov.max35@gmail.com>
  • Loading branch information
Marishka17 and zhiltsov-max committed May 10, 2023
1 parent 9a97050 commit ff83c00
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion datumaro/plugins/coco_format/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import os.path as osp
from glob import glob

from datumaro.components.errors import DatasetNotFoundError
from datumaro.components.extractor import DEFAULT_SUBSET_NAME, Importer
from datumaro.components.format_detection import FormatDetectionConfidence, FormatDetectionContext
from datumaro.plugins.coco_format.extractor import (
Expand Down Expand Up @@ -65,7 +66,7 @@ def __call__(self, path, **extra_params):
subsets = self.find_sources(path)

if len(subsets) == 0:
raise Exception("Failed to find 'coco' dataset at '%s'" % path)
raise DatasetNotFoundError("Failed to find 'coco' dataset at '%s'" % path)

# TODO: should be removed when proper label merging is implemented
conflicting_types = {
Expand Down

0 comments on commit ff83c00

Please sign in to comment.