LikeLy-Journey / SegmenTron

Support PointRend, Fast_SCNN, HRNet, Deeplabv3_plus(xception, resnet, mobilenet), ContextNet, FPENet, DABNet, EdaNet, ENet, Espnetv2, RefineNet, UNet, DANet, HRNet, DFANet, HardNet, LedNet, OCNet, EncNet, DuNet, CGNet, CCNet, BiSeNet, PSPNet, ICNet, FCN, deeplab)
Apache License 2.0
695 stars 162 forks source link

Deeplab V3+ MobileNetV2 training error #31

Open Alanjunhao opened 4 years ago

Alanjunhao commented 4 years ago

when use downloaded MobileNet v2, got flops and params error: Given groups=1, weight of size 182 728 3 3, expected input[1, 96, 64, 128] to have 728 channels, but got 96 channels instead

and then in mobilenet.py line 134, in forward: x = self.conv1(x), got UnboundLocalError: local variable 'total_ops' referenced before assignment

Other models such as use xception65 as backbone are doing fine

LikeLy-Journey commented 4 years ago

I can not reproduce your error by using configs/cityscapes_deeplabv3_plus_mobilenet.yaml

edwardcho commented 4 years ago

Hello Sir,

I tested your code using my datasets (image resolution : 256).

I was succeed deeplabv3_plus based on mobilenet_v2. but I was failed deeplabv3_plus based on hrnet_w18_small_v1.

What can I do check file this problems??

Thanks.

BlueWinters commented 4 years ago

I meet the same problem, this is due the process: https://github.com/LikeLy-Journey/SegmenTron/blob/master/tools/train.py

if get_rank() == 0:
    try:
        show_flops_params(self.model, args.device)
    except Exception as e:
        logging.warning('get flops and params error: {}'.format(e))

function show_flops_params add some hooks which lead to the error. Just comment it out.