msracver / Deformable-ConvNets

Deformable Convolutional Networks
MIT License
4.04k stars 959 forks source link

Deeplab pretrained model error #85

Closed StOnEGiggity closed 7 years ago

StOnEGiggity commented 7 years ago

Hello, I use deeplab pretrained model with imagenet you offered and symbol, but I get strange result in the early epochs, validation iou is 0.01 used by my own metric. It's normal in other network.So it may has nothing to do with metric or data loader. The problem may lie in initialization. Look forward to your reply

chowkamlee81 commented 7 years ago

Hai, In deeplab/symbol/resnet_v1_101_deeplab.py, i added few modules for enhancement code below. After adding the code below mentioned, i got exception at sym_instance.init_weights(config, arg_params, aux_params) in the file deeplab/deeplab_train_test.py Exception arg_params['score_weight'] = mx.random.normal(0, 0.01, shape=self.arg_shape_dict['score_weight']) KeyError: 'score_weight'

Pls kindly suggest since i really don't how to proceed. I got messes up. Pls help Code: upscale_factor = 16 upsampling = mx.symbol.Deconvolution(data=score, num_filter=num_classes, kernel=(32, 32), stride=(16, 16), num_group=num_classes, no_bias=True, name='upsampling', attr={'lr_mult': '0.0'},workspace=self.workspace) interim_featmap = mx.symbol.Convolution(name='interim_featmap', data=relu_fc6, num_filter=upscale_factorupscale_factornum_classes, pad=(0,0), kernel=(1, 1), stride=(1, 1),no_bias=True) splitted = mx.symbol.reshape(name='splitted', data=interim_featmap, shape=(0, -4, -1, upscale_factor*2, 0, 0)) unflatten = mx.symbol.reshape(name='unflatten', data=splitted, shape=(0, 0, -4, upscale_factor, upscale_factor, 0, 0)) swapped = mx.symbol.transpose(name='swapped', data=unflatten, axes=(0, 1, 2, 4, 3, 5)) upsampling_featmap = mx.symbol.reshape(name='upsampling_featmap', data=swapped, shape=(0, 0, -3, -3)) label_map = mx.symbol.max(name='maximum',data = upsampling_featmap, axis=1, exclude=False) croped_score = mx.symbol.Crop([upsampling_featmap, data], offset=(8, 8), name='croped_score') softmax = mx.symbol.SoftmaxOutput(data=croped_score, label=seg_cls_gt, normalization='valid', multi_output=True, use_ignore=True, ignore_label=255, name="softmax")