bonlime / keras-deeplab-v3-plus

Keras implementation of Deeplab v3+ with pretrained weights
MIT License
1.35k stars 428 forks source link

Loading weights from deeplabv3_mnv2_dm05_pascal_trainaug #132

Open selimbek opened 4 years ago

selimbek commented 4 years ago

Hi everyone,

I successfuly manage to load other pretrained weights from Deeplab v3+ Model zoo. I have not encountered any issue with ade20k.

But when I try to load weights for deeplabv3_mnv2_dm05_pascal_trainaug i get this error: Loading weights from weights/mobilenetv2_dm05 4%|###7 | 6/164 [00:00<00:06, 24.00it/s] Traceback (most recent call last): File "load_weights.py", line 34, in <module> layer.set_weights(weights) File "D:\Program Files\Python35\lib\site-packages\tensorflow_core\python\keras\engine\base_layer.py", line 1305, in set_weights 'shape %s' % (ref_shape, weight.shape)) ValueError: Layer weight shape (1, 1, 48, 16) not compatible with provided weight shape (1, 1, 48, 12)

My model is generated in load_weights with

model = Deeplabv3(input_shape=(513, 513, 3), classes=21, backbone="mobilenetv2", weights="dm05", alpha=0.5)

And of course inside model.py i manage dm05 to load weights from correct path I'm assuming that Depth-Multiplier and Alpha represent the same things.

If you have any idea. Or any recommandations to load a pretrained Mobilnetv2 only.

Best regards, --Selim