jakeret / tf_unet

Generic U-Net Tensorflow implementation for image segmentation
GNU General Public License v3.0
1.9k stars 748 forks source link

This is what I do to make the shapes between input data and prediction equal. #280

Open XiangyuWu opened 5 years ago

XiangyuWu commented 5 years ago

Since many users had suffered from the unequal shapes between input data and prediction, I tried to write down my solution here. Hope it helpful.

  1. Make sure the data shape is power-of-two, 256, 512, etc.
  2. Comment the lines "size -= 2 2 (filter_size // 2) # valid conv" in unet.py.
  3. Replace all "VALID" to "SAME" in "layers.py".

They work well for me to segment a 512*512 image.