0

when i run this code

 import os
 from autokeras import 
 StructuredDataClassifier
 import stellargraph as sg
 from stellargraph.mapper import 
 FullBatchNodeGenerator
 from tensorflow.keras import layers, 
 optimizers, losses, metrics, Model
 from sklearn import preprocessing, 
 model_selection
 from IPython.display import display, HTML
 import matplotlib.pyplot as plt
 %matplotlib inline

i have this error

 AttributeError: module 'keras.layers.normalization' has no attribute 'BatchNormalizationBase'

Knowing that this code has been run many times without any problems

muhammad
  • 37
  • 2
  • 7

2 Answers2

1

In my case which had a structure like this:

enter image description here

I added these two lines to the__init__.py file:

from keras.layers.normalization.layer_normalization import *
from keras.layers.normalization.batch_normalization import *

And problem fixed.

Dharman
  • 30,962
  • 25
  • 85
  • 135
AbbasEbadian
  • 653
  • 5
  • 15
0

restart runtime then reinstall keras library

Axisnix
  • 2,822
  • 5
  • 19
  • 41
muhammad
  • 37
  • 2
  • 7