Custom max_pool layer: ValueError: The channel dimension of the inputs should be defined. Found `None`
问题 I am working on tensorflow2 and I am trying to implement Max unpool with indices to implement SegNet. When I run it I get the following problem. I am defining the def MaxUnpool2D and then calling it in the model. I suppose that the problem is given by the fact that updates and mask have got shape (None, H,W,ch). def MaxUnpooling2D(updates, mask): size = 2 mask = tf.cast(mask, 'int32') input_shape = tf.shape(updates, out_type='int32') # calculation new shape output_shape = ( input_shape[0],