DrSleep / light-weight-refinenet

Light-Weight RefineNet for Real-Time Semantic Segmentation
Other
734 stars 163 forks source link

The mobilenetV2 produced abnormal results #38

Closed wujiaju closed 5 years ago

wujiaju commented 5 years ago

I adapted the function create_segmenter in train.py, by adding a branch as follow:

 elif str(net) == 'mbv2':
        from models.mobilenet import mbv2
        return mbv2(num_classes, pretrained=pretrained)

I also adapted other necessary codes such as dataloader and then I ran the code using provided mbv2 on NYU and cityscapes. But I got very low mIoUs on both these datasets. The results were similar to follow and almost invariant during training:

IoUs: [0.233812, 0, 0, 0, 0, 0, 0, ...] 
Mean IoU: 0.006 

It seemed that the model classify all pixels as background.

I also ran the provided resnet101 and its results were normal. Is there something wrong with the code in mobilenet.py ?

zhouyuan888888 commented 5 years ago

@wujiaju I also come across this issue, have you ever find some tricks to overcome this problem?

wujiaju commented 5 years ago

@zhouyuan888888 No. I did't check the code.

DrSleep commented 5 years ago

MobileNet-v2 requires different hyperparams + you need to load-in ImageNet-pretrained weights for it

zhouyuan888888 commented 5 years ago

@DrSleep Can you give me a link to ImageNet-pretrained weights~~0(_)0, thank you

DrSleep commented 5 years ago

https://github.com/tonylins/pytorch-mobilenet-v2

zhouyuan888888 commented 5 years ago

@DrSleep Hi, thank you so much0(#_#)0

zhouyuan888888 commented 5 years ago

@DrSleep Hello,T_T, I have download the pretrained weights as you provided, but there are some misstakes: Missing key(s) in state_dict: "layer1.0.weight", "layer1.1.running_var", "layer1.1.bias", "layer1.1.weight", "layer1.1.running_mean", "layer2.0.output.0.0.weight", "layer2.0.output.0.1.running_var", "layer2.0.output.0.1.bias"........

can you give me some tips to fix this bugT_T.

DrSleep commented 5 years ago

There might have been some changes in that repo since I used it. You may need to convert the weights manually instead

On Sat, 29 Jun 2019 6:56 pm sky, notifications@github.com wrote:

@DrSleep https://github.com/DrSleep Hello,T_T, I have download the pretrained weights as you provided, but there are some misstakes: Missing key(s) in state_dict: "layer1.0.weight", "layer1.1.running_var", "layer1.1.bias", "layer1.1.weight", "layer1.1.running_mean", "layer2.0.output.0.0.weight", "layer2.0.output.0.1.running_var", "layer2.0.output.0.1.bias"........

can you give me some tips to fix this bugT_T.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/DrSleep/light-weight-refinenet/issues/38?email_source=notifications&email_token=AB32NGAW4Y6YXPBAPWKF2ODP5AHF7A5CNFSM4HNTJPAKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODY4DLKQ#issuecomment-507000234, or mute the thread https://github.com/notifications/unsubscribe-auth/AB32NGA7AVB5FXKBUWR4UITP5AHF7ANCNFSM4HNTJPAA .

zhouyuan888888 commented 5 years ago

@DrSleep T_T

YYingcute commented 4 years ago

Can you provide the details of the hyperparams Settings @DrSleep