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

Quantization Debugger Colab Crash #5018

Open
pavel-macenauer-nxp opened this issue Dec 19, 2024 · 0 comments
Open

Quantization Debugger Colab Crash #5018

pavel-macenauer-nxp opened this issue Dec 19, 2024 · 0 comments
Labels

Comments

@pavel-macenauer-nxp
Copy link

Describe the current behavior
When running https://colab.research.google.com/github/tensorflow/tensorflow/blob/master/tensorflow/lite/g3doc/performance/quantization_debugger.ipynb the notebook crashes on the "Boilerplates and helpers" section.

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
[<ipython-input-16-f5bd5b09859a>](https://localhost:8080/#) in <cell line: 43>()
     41 
     42 
---> 43 model = tf.keras.Sequential([
     44   tf.keras.layers.Input(shape=(224, 224, 3), batch_size=1),
     45   hub.KerasLayer(MODEL_URI)

1 frames
[/usr/local/lib/python3.10/dist-packages/keras/src/models/sequential.py](https://localhost:8080/#) in add(self, layer, rebuild)
     95                 layer = origin_layer
     96         if not isinstance(layer, Layer):
---> 97             raise ValueError(
     98                 "Only instances of `keras.Layer` can be "
     99                 f"added to a Sequential model. Received: {layer} "

ValueError: Only instances of `keras.Layer` can be added to a Sequential model. Received: <tensorflow_hub.keras_layer.KerasLayer object at 0x7b77f8034610> (of type <class 'tensorflow_hub.keras_layer.KerasLayer'>)

Describe the expected behavior
Does not crash.

What web browser you are using
Chrome.

Additional context

import tf_keras as tfk
...
model = tfk.Sequential([
  tfk.layers.Input(shape=(224, 224, 3), batch_size=1),
  hub.KerasLayer(MODEL_URI)
])

The above fixes the issue, it's caused by incompatible keras version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant