Skip to content

Commit

Permalink
handling import error when installing datumaro with default option only
Browse files Browse the repository at this point in the history
  • Loading branch information
Yi, Jihyeon committed Apr 18, 2024
1 parent 6988d69 commit 882645f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
(<https://github.com/openvinotoolkit/datumaro/pull/1450>)

### Bug fixes
- Fix CLI error occurring when installed with default option only
(<https://github.com/openvinotoolkit/datumaro/issues/1444>, <https://github.com/openvinotoolkit/datumaro/pull/1454>)
- Relax Pillow dependency constraint
(<https://github.com/openvinotoolkit/datumaro/pull/1436>)
- Modify Numpy dependency constraint
Expand Down
16 changes: 8 additions & 8 deletions src/datumaro/components/extractor_tfds.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2021-2023 Intel Corporation
# Copyright (C) 2024 Intel Corporation
#
# SPDX-License-Identifier: MIT

Expand Down Expand Up @@ -30,23 +30,23 @@
from datumaro.components.annotation import AnnotationType, Bbox, Label, LabelCategories
from datumaro.components.dataset_base import CategoriesInfo, DatasetInfo, DatasetItem, IDataset
from datumaro.components.media import Image, MediaElement
from datumaro.util.import_util import lazy_import
from datumaro.util.tf_util import import_tf

TFDS_EXTRACTOR_AVAILABLE = True if find_spec("tensorflow_datasets") is not None else False

if TYPE_CHECKING:
if TFDS_EXTRACTOR_AVAILABLE:
try:
tf = import_tf()
import tensorflow_datasets as tfds
if TYPE_CHECKING:
tf = import_tf()
import tensorflow_datasets as tfds
else:
tfds = lazy_import("tensorflow_datasets")
except ImportError:
log.debug(
"Unable to import TensorFlow or TensorFlow Datasets. "
"Dataset downloading via TFDS is disabled."
)
else:
from datumaro.util.import_util import lazy_import

tfds = lazy_import("tensorflow_datasets")


@frozen(kw_only=True)
Expand Down

0 comments on commit 882645f

Please sign in to comment.