Skip to content

Too many upsampling layers in decoder when reducing depth of FPN #177

@JulienMaille

Description

@JulienMaille

https://github.com/qubvel/segmentation_models.pytorch/blob/af46195d9a805e621017e95aae6d02ca47df78b0/segmentation_models_pytorch/fpn/decoder.py#L99-L102

I tried a FPN-Resnet with 3 layers and I get a prediction 2 times too big when computing loss.
I believe you should adapt the number of SegmentationBlock, something like this

self.seg_blocks = nn.ModuleList([
    SegmentationBlock(pyramid_channels, segmentation_channels, n_upsamples=n_upsamples)
    for n_upsamples in reversed(range(encoder_depth-1))
])

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions