BloodAxe/Catalyst-Inria-Segmentation-Example

hrnet34_unet64

xdtl opened this issue · 1 comments

xdtl commented

I cannot find definition of model "hrnet34_unet64". So I made it as follows in unet.py:

def hrnet34_unet64(input_channels=3, num_classes=1, dropout=0.0, pretrained=True):
    encoder = E.HRNetV2Encoder34(pretrained=pretrained, layers=[0, 1, 2, 3, 4])
    if input_channels != 3:
        encoder.change_input_channels(input_channels)

    return UnetSegmentationModel(encoder, num_classes=num_classes, unet_channels=[64, 128, 256, 512], dropout=dropout)``

I also tried "hrnet18_unet32" and "hrnet34_unet32", and none of them works correctly.

``RuntimeError: Sizes of tensors must match except in dimension 2. Got 128 and 256 (The offending index is 0)```

Could you please let me know what is wrong? Thanks!
xdtl commented

I think my question is how hrnet is used as an encoder and connected with an unet decoder, and how those layers correspond to stages in hrnet. Thanks!