akirasosa / mobile-semantic-segmentation

Real-Time Semantic Segmentation in Mobile device
MIT License
715 stars 135 forks source link

Matching shapes #13

Closed arnonkahani closed 6 years ago

arnonkahani commented 6 years ago

First of all thanks for this great repo and project.

I'm using an image of the size 240 and not 128 and when running the train_full script or any other method of training I receive the following error in the net instantiation (building) procedure:

ValueError:Concatenatelayer requires inputs with matching shapes except for the concat axis. Got inputs shapes: [(None, 16, 16, 512), (None, 15, 15, 512)]

This error happens when the following layer is constructed

up1 = concatenate([
        Conv2DTranspose(filters, (2, 2), strides=(2, 2), padding='same')(b13),
        b11,
    ], axis=3)

Any idea why? or how to solve it?

Furthermore how would you suggest that use the net for arbitrary size of an image (w,h) where w != h

akirasosa commented 6 years ago

@arnonkahani What size is your input image? I remember that it must be divided by 32. For example, 128, 160, 192 and 224 are OK.

arnonkahani commented 6 years ago

I managed to make it work for my use case , thanks for the help.