Autokeras Import Bug Report

26 views
Skip to first unread message

Aya Abd El Moniem

unread,
Mar 12, 2024, 5:04:18 PMMar 12
to keras...@googlegroups.com
Good Day 
This is Aya and I am preparing for my masters and using Autokeras as my master's algorithm. The problem I find nowadays is that when I execute
Import Autokeras as ak

I get the following error message

ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-7-b83d4d65612e> in <cell line: 8>()      6 from keras.utils import to_categorical      7 import numpy as np ----> 8 import autokeras as ak      9 import matplotlib.pyplot as plt     10 plt.style.use('fivethirtyeight')

7 frames

/usr/local/lib/python3.10/dist-packages/autokeras/keras_layers.py in <module>     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'

and I am using google colab and I hadn't had this problem 2 days ago but now It causes the entire thing to stop working and as you know It is a really important library for the rest of the code.
I would appreciate it if you could look into this problem
 Regards 

François Chollet

unread,
Mar 12, 2024, 7:24:24 PMMar 12
to Aya Abd El Moniem, keras...@googlegroups.com
See this: https://keras.io/getting_started/#tensorflow--keras-2-backwards-compatibility

You need to export TF_USE_LEGACY_KERAS=1 in order for tf.keras to point to the legacy Keras 2 package.

--
You received this message because you are subscribed to the Google Groups "Keras-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to keras-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/keras-users/VI1P192MB226483C5CC572D5FF4847D01F12B2%40VI1P192MB2264.EURP192.PROD.OUTLOOK.COM.
Reply all
Reply to author
Forward
0 new messages