Hi, I struck over with the error , please help .Thank you.
happy_model = happyModel()
# Print a summary for each layer
for layer in summary(happy_model):
print(layer)
output = [['ZeroPadding2D', (None, 70, 70, 3), 0, ((3, 3), (3, 3))],
['Conv2D', (None, 64, 64, 32), 4736, 'valid', 'linear', 'GlorotUniform'],
['BatchNormalization', (None, 64, 64, 32), 128],
['ReLU', (None, 64, 64, 32), 0],
['MaxPooling2D', (None, 32, 32, 32), 0, (2, 2), (2, 2), 'valid'],
['Flatten', (None, 32768), 0],
['Dense', (None, 1), 32769, 'sigmoid']]
ERROR:
comparator(summary(happy_model), output)
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-36-f33284fd82fe> in <module>
----> 1 happy_model = happyModel()
2 # Print a summary for each layer
3 for layer in summary(happy_model):
4 print(layer)
5
<ipython-input-35-127bf9124664> in happyModel()
34
35 ## Flatten layer
---> 36 tfl.Flatten(tfl.MaxPool2D(pool_size=(0, 0), padding='valid')),
37
38 ## Dense layer with 1 unit for output & 'sigmoid' activation
/opt/conda/lib/python3.7/site-packages/tensorflow/python/keras/layers/core.py in __init__(self,
data_format, **kwargs)
642 def __init__(self, data_format=None, **kwargs):
643 super(Flatten, self).__init__(**kwargs)
--> 644 self.data_format = conv_utils.normalize_data_format(data_format)
645 self.input_spec = InputSpec(min_ndim=1)
646 self._channels_first = self.data_format == 'channels_first'
/opt/conda/lib/python3.7/site-packages/tensorflow/python/keras/utils/conv_utils.py in
normalize_data_format(value)
190 if value is None:
191 value = backend.image_data_format()
--> 192 data_format = value.lower()
193 if data_format not in {'channels_first', 'channels_last'}:
194 raise ValueError('The `data_format` argument must be one of '
AttributeError: 'MaxPooling2D' object has no attribute 'lower'