Hi i am getting the following error
ValueError Traceback (most recent call last)
in
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
in conv_block(inputs, n_filters, dropout_prob, max_pooling)
37 if max_pooling:
38 ### START CODE HERE
—> 39 next_layer = MaxPooling2D(pool_size=(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)
178 ‘expected ndim=’ + str(spec.ndim) + ‘, found ndim=’ +
179 str(ndim) + '. Full shape received: ’ +
→ 180 str(x.shape.as_list()))
181 if spec.max_ndim is not None:
182 ndim = x.shape.ndims
ValueError: Input 0 of layer max_pooling2d_13 is incompatible with the layer: expected ndim=4, found ndim=0. Full shape received: