unet icon indicating copy to clipboard operation
unet copied to clipboard

Got an error when training on different sizes images.

Open lishangqiu opened this issue 5 years ago • 2 comments

Error Message: ValueError: A Concatenate layer requires inputs with matching shapes except for the concat axis. Got inputs shapes: [(None, 25, 25, 512), (None, 24, 24, 512)] Obviously, there's a structure problem.

lishangqiu avatar Aug 15 '19 03:08 lishangqiu

This might be because u-net architecture consists of contracting path(conv, max pooling) and expansion path (upsampling, concatenation), when we down sample image of shape [(None,25,25,512)] we will get [None,12,12,512], on other hand when we upsample image and concate we will det [None,24,24,512].

So resize input image according to architecture needs.

sudhasubramaniam avatar Aug 16 '19 05:08 sudhasubramaniam

Hi, If the raw image is much larger than 512*512, how can resize the image for the requirement of the code?

HuiZhang22 avatar Mar 24 '22 00:03 HuiZhang22