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
how to solve this error ? : AttributeError: module 'keras._tf_keras.keras.layers' has no attribute 'experimental' #64349
Comments
workaround is to limit the tensorflow version and comment out keras from object detection>packages>tf2>setup.py as:
|
Hi @Rajcr2 ,
-Verify the versions of TensorFlow and Keras you have installed to ensure compatibility.
-In your script model_builder_tf2_test.py, ensure that you're importing the correct modules and classes. |
hey how do i ensure whether i'm importing the correct modules and classes in the script model_builder_tf2_test.py? |
Same issue. @DineshNeupane commenting keras also not working. |
Did you solve it?
…On Fri, 5 Apr 2024, 11:00 am Girraj Sharma, ***@***.***> wrote:
Same issue
—
Reply to this email directly, view it on GitHub
<#64349 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A7CL4324T2VJ3VFP7TREMYLY3YZGVAVCNFSM6AAAAABFEPPIFCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMZYHE3TGOJVG4>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
try this, helped for me |
Hi @Rajcr2 , The issue seems to be a compatible issues related to TF/Keras version vs tf_models version. As Keras3 now built to support multiple backends there are some changes in design. Please provide more context and environment details like which TF/keras version,tf-models-official version etc for more details. Please check setup.py of models repo for TF version compatibility. |
This issue is stale because it has been open for 7 days with no activity. It will be closed if no further activity occurs. Thank you. |
If you are using the latest version of tensorflow, you will likey encounter this error. Tensorflow no longer have 'experimental' module under the 'keras.layers' module. You can access the preprocessing libraries directly under tf.keras.layers instead of tf.keras.layers.experimental.preprocessing. For example, you can do: tf.keras.layers.RandomRotation(0.15), instead of: tf.keras.layers.experimental.preprocessing.RandomRotation(0.15), |
Hi im still facing this error can you please help me |
Can I see your code ? |
yea can i text you in private ? |
Also seeing this. This is for automation so would rather the fix come from upstream than any manual patch so I'll be watching - appreciate the effort! File "models/official/modeling/optimization/lr_schedule.py", line 89, in |
I am also dealing with this problem. |
Ok so I found the solution for this. I found that tensorflow version 2.16.1 changed keras module such as the current calls using 1.x fail. I found the fix by searching similar issues and looking at tf docs. latest version 2.16.1 --> https://www.tensorflow.org/api_docs/python/tf/keras/optimizers/schedules/CosineDecay @Rajcr2 Please, consider trying this and marking it as solved. |
So, can we do object detection in latest version of tf? |
Issue type
Bug
Have you reproduced the bug with TensorFlow Nightly?
Yes
Source
source
TensorFlow version
tf 2.15.0
Custom code
Yes
OS platform and distribution
No response
Mobile device
No response
Python version
No response
Bazel version
No response
GCC/compiler version
No response
CUDA/cuDNN version
No response
GPU model and memory
No response
Current behavior?
Got this Error while installing object detection tensorflow api.
command :
!python object_detection/builders/model_builder_tf2_test.py
Standalone code to reproduce the issue
Relevant log output
No response
The text was updated successfully, but these errors were encountered: