qubvel / segmentation_models

Segmentation models with pretrained backbones. Keras and TensorFlow Keras.
MIT License
4.67k stars 1.03k forks source link

how to trian non-square image with Unet? #502

Closed pure-rgb closed 2 years ago

pure-rgb commented 2 years ago

My image sizes are 670, 460, and divisible by 32 but yet I'm facing a concatenation error with unet.

https://github.com/qubvel/segmentation_models/blob/94f624b7029deb463c859efbd92fa26f512b52b8/segmentation_models/models/unet.py#L183

I defined my model as follows

sm.Unet('efficientnetb5', 
                input_shape=(670, 460, 3),
                classes=10, 
               activation=activation)
ValueError: A `Concatenate` layer requires inputs with matching shapes except for the concat axis.

How to solve this?

pure-rgb commented 2 years ago

@qubvel

qubvel commented 2 years ago

Sorry, 670 is not divisible by 32