Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip layer connections from the second layer #19

Open
zhou-rui1 opened this issue Jul 30, 2021 · 3 comments
Open

Skip layer connections from the second layer #19

zhou-rui1 opened this issue Jul 30, 2021 · 3 comments

Comments

@zhou-rui1
Copy link

Hi, when I try to edit the unet to unet++, it seems that the horizontal connections are only added from the second layer, and the last output layer is up-sampled by one layer to restore the dimensions, which is not the same as the original model.

is this for the design to use the pretrained model?

With great appreciation!

@zhou-rui1
Copy link
Author

Hi, and plus...how did you get the channel calculation function for unet to adapt to different backbones...I have trouble when I change the structure to unet++

b4448e4858a2e98ffa95a7837094837
a4e328ff89f292e4f115a1ecf1ee885

@IanTaehoonYoo
Copy link
Owner

IanTaehoonYoo commented Aug 2, 2021

Hi, Zhou
It's different between your snapshot and my code. The 'get_last_out_channels' function gets the last channel of features. So you don't need 'cfi_idx' in 'get_last_out_channels' and reconsider to use 'self.features[cfi_idx] as features'.
Also, I checked my code and the unet is working as the original model.
스크린샷 2021-08-02 오후 2 38 46

스크린샷 2021-08-02 오후 2 39 55

Thanks,

@zhou-rui1
Copy link
Author

zhou-rui1 commented Aug 2, 2021

Thanks for your reply!
Yes, I found out that this is because the first layer of vgg is divided into two layers in resnet....
b5039c459e846a03cadb47536a30144

I change 'get_last_out_channels' to plus the number of channels added by the unet++ dense connection, and it seems I am unable to get a channel calculation function like you designed for unet, thus I can not change the backbones directly
407acfa95724f4ecae4fd29b8d2ecb5

but if use 'self.features[cfi_idx] as features', the features are backbone

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants