Skip to content

kagglehub dependency error #2519

Closed
Closed
@t-kalinowski

Description

kagglehub is currently broken with Kaggle/kagglehub#224, which unfortunately means that keras_cv is currently broken.

Specifically, the call keras_cv.models.SegmentAnythingModel.from_preset("sam_huge_sa1b") will error.

To reproduce with uv:

uv run --exclude-newer 2025-01-31 \
  --python 3.11 --with kagglehub --with keras_cv --with tensorflow-cpu \
  python -c 'import keras_cv;  keras_cv.models.SegmentAnythingModel.from_preset("sam_huge_sa1b")'

I see:

$ uv run --exclude-newer 2025-01-31 --python 3.11 --with kagglehub --with keras_cv --with tensorflow-cpu python -c 'import keras_cv;  keras_cv.models.SegmentAnythingModel.from_preset("sam_huge_sa1b")'
2025-02-13 09:32:38.042738: I tensorflow/core/platform/cpu_feature_guard.cc:210] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/tomasz/.cache/uv/archive-v0/Ox_J6nyXW2jDLpQelMc-b/lib/python3.11/site-packages/keras_cv/src/models/task.py", line 184, in from_preset
    return super(cls, calling_cls).from_preset(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomasz/.cache/uv/archive-v0/Ox_J6nyXW2jDLpQelMc-b/lib/python3.11/site-packages/keras_cv/src/models/task.py", line 136, in from_preset
    preset_cls = check_preset_class(preset, (cls, Backbone))
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomasz/.cache/uv/archive-v0/Ox_J6nyXW2jDLpQelMc-b/lib/python3.11/site-packages/keras_cv/src/utils/preset_utils.py", line 179, in check_preset_class
    config_path = get_file(preset, config_file)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tomasz/.cache/uv/archive-v0/Ox_J6nyXW2jDLpQelMc-b/lib/python3.11/site-packages/keras_cv/src/utils/preset_utils.py", line 39, in get_file
    raise ImportError(
ImportError: `from_preset()` requires the `kagglehub` package. Please install with `pip install kagglehub`.

Changing --exclude-newer to the day prior 2025-01-30, the call succeeds.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions