yingkaisha / keras-unet-collection

The Tensorflow, Keras implementation of U-net, V-net, U-net++, UNET 3+, Attention U-net, R2U-net, ResUnet-a, U^2-Net, TransUNET, and Swin-UNET with optional ImageNet-trained backbones.
MIT License
665 stars 185 forks source link

Possible bug in number of tensors for layer fusion #60

Open TheOnlyError opened 2 years ago

TheOnlyError commented 2 years ago

The figure below shows that the value of a decoder neuron is based on 5 other values:

image

When trying to reproduce this in the code, I get the following:

image

The number of tensors is equal to 4 instead of 5. This suggest there is a bug in the code around the following lines:

https://github.com/yingkaisha/keras-unet-collection/blob/d30f14a259656d2f26ea11ed978255d6a7d0ce37/keras_unet_collection/_model_unet_3plus_2d.py#L142-L150

I think the second for loop should have depth_decode+1 as the upper boundary in the range. Is this indeed a bug?

ziyangwang007 commented 2 years ago

I also noticed that the X1EN can not be copied and crop to the decoder part through multi-scale skip connections each time. I agree with you.