-
Notifications
You must be signed in to change notification settings - Fork 303
Closed
Description
Moving from keras-team/keras-cv#2519.
The current set of keras-hub dependencies results in a non-functional installation unless prerelease versions of betterproto are explicitly pulled.
uv run --python 3.11.11 --with keras-hub python -c 'import keras_hub; keras_hub.models.SAMImageSegmenter.from_preset("sam_huge_sa1b")'
$ uv run --python 3.11.11 --with keras-hub python -c 'import keras_hub; keras_hub.models.SAMImageSegmenter.from_preset("sam_huge_sa1b")'
Installed 57 packages in 243ms
2025-02-13 14:22:00.005165: I external/local_xla/xla/tsl/cuda/cudart_stub.cc:32] Could not find cuda drivers on your machine, GPU will not be used.
2025-02-13 14:22:00.007878: I external/local_xla/xla/tsl/cuda/cudart_stub.cc:32] Could not find cuda drivers on your machine, GPU will not be used.
2025-02-13 14:22:00.014952: E external/local_xla/xla/stream_executor/cuda/cuda_fft.cc:477] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
E0000 00:00:1739474520.028928 6974 cuda_dnn.cc:8310] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered
E0000 00:00:1739474520.032840 6974 cuda_blas.cc:1418] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered
2025-02-13 14:22:00.047559: 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/r-reticulate/uv-cache/archive-v0/PNLAiwmYQ3TpiwDlaCtp6/lib/python3.11/site-packages/keras_hub/src/models/task.py", line 184, in from_preset
loader = get_preset_loader(preset)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/tomasz/.cache/r-reticulate/uv-cache/archive-v0/PNLAiwmYQ3TpiwDlaCtp6/lib/python3.11/site-packages/keras_hub/src/utils/preset_utils.py", line 509, in get_preset_loader
if not check_file_exists(preset, CONFIG_FILE):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/tomasz/.cache/r-reticulate/uv-cache/archive-v0/PNLAiwmYQ3TpiwDlaCtp6/lib/python3.11/site-packages/keras_hub/src/utils/preset_utils.py", line 264, in check_file_exists
get_file(preset, path)
File "/home/tomasz/.cache/r-reticulate/uv-cache/archive-v0/PNLAiwmYQ3TpiwDlaCtp6/lib/python3.11/site-packages/keras_hub/src/utils/preset_utils.py", line 143, in get_file
raise ImportError(
ImportError: `from_preset()` requires the `kagglehub` package. Please install with `pip install kagglehub`.
Adding --exclude-newer 2025-01-30
or --prerelease allow
to the uv command makes it succeed.
See also: Kaggle/kagglehub#224