Skip to content

Tutorial Bug: TFA module keras.src.engine not found #4

@mahmoud-shihab

Description

@mahmoud-shihab

When trying to run tutorial.ipynb on colab, I get the following error:

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
[<ipython-input-4-dc0e936f3eed>](https://localhost:8080/#) in <cell line: 0>()
     13 import tensorflow_datasets as tfds
     14 import tensorflow_probability as tfp
---> 15 import tensorflow_addons as tfa
     16 
     17 from tensorflow.keras.layers import Conv2D, Conv3D, Dense, Lambda, BatchNormalization, GlobalAveragePooling2D, Flatten, Dropout, Embedding, TimeDistributed, MaxPool2D, AvgPool2D

3 frames
[/usr/local/lib/python3.11/dist-packages/tensorflow_addons/utils/types.py](https://localhost:8080/#) in <module>
     27     # New versions of Keras require importing from `keras.src` when
     28     # importing internal symbols.
---> 29     from keras.src.engine import keras_tensor
     30 elif Version(tf.__version__).release >= Version("2.5").release:
     31     from keras.engine import keras_tensor

ModuleNotFoundError: No module named 'keras.src.engine'

---------------------------------------------------------------------------
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.

To view examples of installing some common dependencies, click the
"Open Examples" button below.
---------------------------------------------------------------------------

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions