SegmentationBLWX / sssegmentation

SSSegmentation: An Open Source Supervised Semantic Segmentation Toolbox Based on PyTorch.
https://sssegmentation.readthedocs.io/en/latest/
Apache License 2.0
795 stars 107 forks source link

mobilenetV3 bug #26

Closed Tensor-king closed 2 years ago

Tensor-king commented 2 years ago
image

se_cf in the mobilenetV3, what does this bias mean, only keep an activation function on the line, otherwise it reports an error

CharlesPikachu commented 2 years ago

Could you please provide the error msg and your running command?

CharlesPikachu commented 2 years ago

It seems that everything goes well when I run:

bash scripts/distrain.sh 2 ssseg/configs/lrasppnet/lrasppnet_mobilenetv3sos8_ade20k.py

or

bash scripts/distrain.sh 2 ssseg/configs/lrasppnet/lrasppnet_mobilenetv3los8_ade20k.py

And bias is defined in https://github.com/SegmentationBLWX/sssegmentation/blob/main/ssseg/modules/models/backbones/bricks/activation/hardsigmoid.py:

class HardSigmoid(nn.Module):
    def __init__(self, bias=1.0, divisor=2.0, min_value=0.0, max_value=1.0):
        super(HardSigmoid, self).__init__()
        assert divisor != 0, 'divisor is not allowed to be equal to zero'
        self.bias = bias
        self.divisor = divisor
        self.min_value = min_value
        self.max_value = max_value
    '''forward'''
    def forward(self, x):
        x = (x + self.bias) / self.divisor
        return x.clamp_(self.min_value, self.max_value)
Tensor-king commented 2 years ago

I'm so sorry I read hardsigmoid as hardswish.

-