Tensorflow Convolution Neural Network with different sized images

前端 未结 2 1495
[愿得一人]
[愿得一人] 2020-12-11 02:27

I am attempting to create a deep CNN that can classify each individual pixel in an image. I am replicating architecture from the image below taken from this paper. In the pa

2条回答
  •  时光取名叫无心
    2020-12-11 02:55

    Theoretically, it's possible. you need to set the image size of the input and label image place holder to none, and let the graph dynamically infer the image size from input data.

    However, have to be careful when you define the graph. Need to use tf.shape instead of tf.get_shape(). the former dynamically infer the shape only when you session.run, the latter can get the shape when you define the graph. But when input size is set to none, the latter does not get true reshape (maybe just return None).

    And to make things complicated, if you use tf.layers.conv2d or upconv2d, sometimes these high level functions do not like tf.shape, because it seems they assume the shape information are available during graph construction.

    I hope I have better working example to show the points above. I'll put this answer as a placeholder and will come back and add more stuff if I get a chance.

提交回复
热议问题