keras-team / autokeras

AutoML library for deep learning
http://autokeras.com/
Apache License 2.0
9.1k stars 1.4k forks source link

ModuleNotFoundError: No module named 'tensorflow.keras.layers.experimental'Bug: #1904

Open veiro opened 3 months ago

veiro commented 3 months ago

Bug Description

when import autokeras

import autokeras as ak

Bug Reproduction

Code for reproducing the bug:

https://colab.research.google.com/github/keras-team/autokeras/blob/master/docs/ipynb/structured_data_classification.ipynb

Setup Details

Include the details about the versions of:

Additional context

in <cell line: 4>() 2 import tensorflow as tf 3 ----> 4 import autokeras as ak

7 frames /usr/local/lib/python3.10/dist-packages/autokeras/keras_layers.py in 18 from tensorflow import nest 19 from tensorflow.keras import layers ---> 20 from tensorflow.keras.layers.experimental import preprocessing 21 22 from autokeras.utils import data_utils

ModuleNotFoundError: No module named 'tensorflow.keras.layers.experimental

Aya121298 commented 3 months ago

I have the same problem

sorowar-cse commented 3 months ago

SaMEEEEEEEE

JingxinLee commented 2 months ago

same

2abet commented 2 months ago

The experimental bit has been rendered redundant. Use tf.keras.layers import RandomFlip instead. https://www.tensorflow.org/api_docs/python/tf/keras/layers/RandomFlip

If you need the full preprocessing.. you can use from tensorflow.keras.layers import *

That should work: didnt try it tho.

odeyale2016 commented 2 days ago

from tensorflow.keras.layers import * The above code works for me