Hi, I think something wrong with this output. I got all test passed but it have attribute error…
Block 1:
['InputLayer', [(None, 96, 128, 3)], 0]
['Conv2D', (None, 96, 128, 32), 896, 'same', 'relu', 'HeNormal']
['Conv2D', (None, 96, 128, 32), 9248, 'same', 'relu', 'HeNormal']
['MaxPooling2D', (None, 48, 64, 32), 0, (2, 2)]
All tests passed!
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-43-a8857f337ac5> in <module>
17
18 inputs = Input(input_size)
---> 19 cblock1 = conv_block(inputs, n_filters * 32, dropout_prob=0.1, max_pooling=True)
20 model2 = tf.keras.Model(inputs=inputs, outputs=cblock1)
21
<ipython-input-42-e001326c4702> in conv_block(inputs, n_filters, dropout_prob, max_pooling)
37 if max_pooling:
38 ### START CODE HERE
---> 39 next_layer = MaxPooling2D((2,2))(conv)
40 ### END CODE HERE
41
/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/engine/base_layer.py in __call__(self, *args, **kwargs)
980 with ops.name_scope_v2(name_scope):
981 if not self.built:
--> 982 self._maybe_build(inputs)
983
984 with ops.enable_auto_cast_variables(self._compute_dtype_object):
/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/engine/base_layer.py in _maybe_build(self, inputs)
2616 if not self.built:
2617 input_spec.assert_input_compatibility(
-> 2618 self.input_spec, inputs, self.name)
2619 input_list = nest.flatten(inputs)
2620 if input_list and self._dtype_policy.compute_dtype is None:
/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/engine/input_spec.py in assert_input_compatibility(input_spec, inputs, layer_name)
164 spec.min_ndim is not None or
165 spec.max_ndim is not None):
--> 166 if x.shape.ndims is None:
167 raise ValueError('Input ' + str(input_index) + ' of layer ' +
168 layer_name + ' is incompatible with the layer: '
AttributeError: 'Dropout' object has no attribute 'shape'