Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pin keras-cv #1325

Merged
merged 1 commit into from
Nov 23, 2023
Merged

Pin keras-cv #1325

merged 1 commit into from
Nov 23, 2023

Conversation

rosbo
Copy link
Contributor

@rosbo rosbo commented Nov 23, 2023

Latest version fails with:

Traceback (most recent call last):
  File "/input/tests/test_keras_cv.py", line 9, in test_inference
    classifier = keras_cv.models.ImageClassifier.from_preset(
  File "/opt/conda/lib/python3.10/site-packages/keras_cv/src/models/task.py", line 196, in from_preset
    return super(cls, calling_cls).from_preset(*args, **kwargs)
  File "/opt/conda/lib/python3.10/site-packages/keras_cv/src/models/task.py", line 147, in from_preset
    model = cls.from_config({**config, **kwargs})
  File "/opt/conda/lib/python3.10/site-packages/keras_cv/src/models/task.py", line 54, in from_config
    config["backbone"] = keras.layers.deserialize(config["backbone"])
  File "/opt/conda/lib/python3.10/site-packages/keras_core/src/layers/__init__.py", line 161, in deserialize
    obj = serialization_lib.deserialize_keras_object(
  File "/opt/conda/lib/python3.10/site-packages/keras_core/src/saving/serialization_lib.py", line 706, in deserialize_keras_object
    instance = cls.from_config(inner_config)
  File "/opt/conda/lib/python3.10/site-packages/keras_cv/src/models/backbones/backbone.py", line 48, in from_config
    return cls(**config)
  File "/opt/conda/lib/python3.10/site-packages/keras_cv/src/models/backbones/efficientnet_v2/efficientnet_v2_backbone.py", line 200, in __init__
    pyramid_level_inputs.append(utils.get_tensor_input_name(x))
  File "/opt/conda/lib/python3.10/site-packages/keras_cv/src/models/utils.py", line 25, in get_tensor_input_name
    return tensor.node.layer.name
AttributeError: 'KerasTensor' object has no attribute 'node'

We can remove the pin once we upgrade TensorFlow & Keras.

http://b/312946339

Latest version fails with:

```
Traceback (most recent call last):
  File "/input/tests/test_keras_cv.py", line 9, in test_inference
    classifier = keras_cv.models.ImageClassifier.from_preset(
  File "/opt/conda/lib/python3.10/site-packages/keras_cv/src/models/task.py", line 196, in from_preset
    return super(cls, calling_cls).from_preset(*args, **kwargs)
  File "/opt/conda/lib/python3.10/site-packages/keras_cv/src/models/task.py", line 147, in from_preset
    model = cls.from_config({**config, **kwargs})
  File "/opt/conda/lib/python3.10/site-packages/keras_cv/src/models/task.py", line 54, in from_config
    config["backbone"] = keras.layers.deserialize(config["backbone"])
  File "/opt/conda/lib/python3.10/site-packages/keras_core/src/layers/__init__.py", line 161, in deserialize
    obj = serialization_lib.deserialize_keras_object(
  File "/opt/conda/lib/python3.10/site-packages/keras_core/src/saving/serialization_lib.py", line 706, in deserialize_keras_object
    instance = cls.from_config(inner_config)
  File "/opt/conda/lib/python3.10/site-packages/keras_cv/src/models/backbones/backbone.py", line 48, in from_config
    return cls(**config)
  File "/opt/conda/lib/python3.10/site-packages/keras_cv/src/models/backbones/efficientnet_v2/efficientnet_v2_backbone.py", line 200, in __init__
    pyramid_level_inputs.append(utils.get_tensor_input_name(x))
  File "/opt/conda/lib/python3.10/site-packages/keras_cv/src/models/utils.py", line 25, in get_tensor_input_name
    return tensor.node.layer.name
AttributeError: 'KerasTensor' object has no attribute 'node'
```

We can remove the pin once we upgrade TensorFlow & Keras.

http://b/312946339
@rosbo rosbo requested review from Philmod and djherbis November 23, 2023 19:06
@rosbo rosbo merged commit 43c512a into main Nov 23, 2023
4 checks passed
@rosbo rosbo deleted the fix-keras-cv branch November 23, 2023 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants