ValueError Traceback (most recent call last)
in
4 num_channels = 3
5
----> 6 unet = unet_model((img_height, img_width, num_channels))
7 comparator(summary(unet), outputs.unet_model_output)
in unet_model(input_size, n_filters, n_classes)
36 # Note that you must use the second element of the contractive block i.e before the maxpooling layer.
37 # At each step, use half the number of filters of the previous block
—> 38 ublock7 = upsampling_block(ublock6[0], cblock3[1], n_filters * 4)
39 ublock8 = upsampling_block(ublock7[0], cblock2[1], n_filters * 2)
40 ublock9 = upsampling_block(ublock8[0], cblock1[1], n_filters)
in upsampling_block(expansive_input, contractive_input, n_filters)
17 kernel_size = (3,3), # Kernel size
18 strides=(2, 2),
—> 19 padding=‘same’)(expansive_input)
20
21 # Merge the previous output and the contractive_input
/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/engine/base_layer.py in call(self, *args, **kwargs)
924 if _in_functional_construction_mode(self, inputs, args, kwargs, input_list):
925 return self._functional_construction_call(inputs, args, kwargs,
→ 926 input_list)
927
928 # Maintains info about the Layer.call stack.
/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/engine/base_layer.py in _functional_construction_call(self, inputs, args, kwargs, input_list)
1090 # TODO(reedwm): We should assert input compatibility after the inputs
1091 # are casted, not before.
→ 1092 input_spec.assert_input_compatibility(self.input_spec, inputs, self.name)
1093 graph = backend.get_graph()
1094 # Use self._name_scope() to avoid auto-incrementing the name.
/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/engine/input_spec.py in assert_input_compatibility(input_spec, inputs, layer_name)
194 ‘, found ndim=’ + str(ndim) +
195 '. Full shape received: ’ +
→ 196 str(x.shape.as_list()))
197 # Check dtype.
198 if spec.dtype is not None:
ValueError: Input 0 of layer conv2d_transpose_2 is incompatible with the layer: : expected min_ndim=4, found ndim=3. Full shape received: [12, 16, 256]
This is the error now im getting