Unable to import BatchNormalization from tensorflow.python.keras.layers

25 views Asked by At

I am trying to run a project. My TensorFlow version is 2.9.2. I need to import BatchNormalization, but I cannot import it. Here is the error message: AttributeError: module 'tensorflow.python.keras.layers' has no attribute 'BatchNormalization' enter image description here enter image description here

I need to import BatchNormalization from TensorFlow.

1

There are 1 answers

0
Chirantan Degloorkar On

This works for me ->

from tensorflow.keras.layers import BatchNormalization

just remove .python from your code