msracver / Deformable-ConvNets

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

Error: when training deeplab use CityScapes dataset #187

Open Toolazy2cruel opened 6 years ago

Toolazy2cruel commented 6 years ago

When I use CityScapes to train deeplab for semantic segmantation, it always appear this Error: IndexError: index 23 is out of bounds for axis 1 with size 19

All the mistakes are as follows,who can help me?

datapath ./data/cityscapes/ num_images 2975 cityscape_leftImg8bit_train gt segdb loaded from ./data/cache/cityscape_leftImg8bit_train_gt_segdb.pkl ('providing maximum shape', [('data', (1, 3, 768, 1024))], [('label', (1, 1, 768, 1024))]) {'data': (1L, 3L, 768L, 1024L), 'label': (1L, 1L, 768L, 1024L)} ./model/pretrained_model/resnet_v1_101 ('lr', 0.0005, 'lr_epoch_diff', [40.336], 'lr_iters', [119999]) Traceback (most recent call last): File "experiments/deeplab/deeplab_train_test.py", line 21, in train.main() File "experiments/deeplab/../../deeplab/train.py", line 159, in main config.TRAIN.begin_epoch, config.TRAIN.end_epoch, config.TRAIN.lr, config.TRAIN.lr_step) File "experiments/deeplab/../../deeplab/train.py", line 153, in train_net arg_params=arg_params, aux_params=aux_params, begin_epoch=begin_epoch, num_epoch=end_epoch) File "experiments/deeplab/../../deeplab/core/module.py", line 979, in fit self.update_metric(eval_metric, data_batch.label) File "experiments/deeplab/../../deeplab/core/module.py", line 1071, in update_metric self._curr_module.update_metric(eval_metric, labels) File "experiments/deeplab/../../deeplab/core/module.py", line 668, in update_metric self._exec_group.update_metric(eval_metric, labels) File "experiments/deeplab/../../deeplab/core/DataParallelExecutorGroup.py", line 487, in update_metric eval_metric.update(labels, texec.outputs) File "/usr/local/lib/python2.7/dist-packages/mxnet/metric.py", line 294, in update metric.update(labels, preds) File "experiments/deeplab/../../deeplab/core/metric.py", line 32, in update cls = pred[keep_inds, label] IndexError: index 23 is out of bounds for axis 1 with size 19

Toolazy2cruel commented 6 years ago

someone can help me?

Toolazy2cruel commented 6 years ago

why the label class is larger than 19?

ChayaBei commented 6 years ago

did you solve it ? i have the same problem

songzenghui commented 6 years ago

I think that your class_num is incorrect. Make sure your class_num in .yaml is equal to the number of your dataset.Notice ,your dataset's class number must plus one ,which is the class_num in .yaml

bitwangdan commented 5 years ago

@Toolazy2cruel did you solve it? i have the same problem