Skip to content

Maxpool 2D layer error Negative dimension size caused by subtracting 2 from 1 input shape shape=(128, 128, 1, 16) #2304

Open
@shreya-ibind

Description

@shreya-ibind

Im trying to convert tensorflow model to onnx.
I have attached my python file.

Error

       raise e.with_traceback(filtered_tb) from None

    ValueError: Exception encountered when calling layer 'max_pooling2d' (type MaxPooling2D).
    
    Negative dimension size caused by subtracting 2 from 1 for '{{node model/max_pooling2d/MaxPool}} = MaxPool[T=DT_FLOAT, data_format="NHWC", explicit_paddings=[], ksize=[1, 2, 2, 1], padding="VALID", strides=[1, 2, 2, 1]](model/leaky_re_lu_1/LeakyRelu)' with input shapes: [128,128,1,16].
    
    Call arguments received by layer 'max_pooling2d' (type MaxPooling2D):
      • inputs=tf.Tensor(shape=(128, 128, 1, 16), dtype=float32)

steps to reproduce

  1. Run the py file attached python case_unet.py
    case_unet.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAn unexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions