ijkguo / mx-rcnn

Parallel Faster R-CNN implementation with MXNet.
Other
671 stars 290 forks source link

ResNet: Problem when using Resnet as base net #31

Closed ghost closed 7 years ago

ghost commented 7 years ago

Hi everyone, I am trying to use resnet-50 as base net of faster r-cnn via mx-rcnn. The resnet-50 model (resnet-50-0000.params resnet-50-symbol.json) is downloaded from mxnet dmlc site. The original VGG16 model could be trained and tested, but when I type in the following command, it gives me 'RuntimeError: conv2_1_bias is not presented'. Could anyone kindly help with this ?

yf@CPDP-Titan:~/mx-rcnn$ python train_alternate.py --gpus 0 --pretrained model/resnet-50 --epoch 0 --rpn_epoch 2 --rcnn_epoch 2 model/resnet-50 INFO:root:########## TRAIN RPN WITH IMAGENET INIT voc_2007_trainval gt roidb loaded from /home/yf/mx-rcnn/data/cache/voc_2007_trainval_gt_roidb.pkl append flipped images to roidb prepare roidb providing maximum shape [('data', (1, 3, 1000, 1000))] [('label', (1, 34596)), ('bbox_target', (1, 36, 62, 62)), ('bbox_inside_weight', (1, 36, 62, 62)), ('bbox_outside_weight', (1, 36, 62, 62))] fitting training data... Traceback (most recent call last): File "train_alternate.py", line 105, in args.frequent, args.kv_store, args.work_load_list) File "train_alternate.py", line 27, in alternate_train 'model/rpn1', ctx, begin_epoch, rpn_epoch, frequent, kv_store, work_load_list) File "/home/yf/mx-rcnn/tools/train_rpn.py", line 102, in train_rpn arg_params=args, aux_params=auxs, begin_epoch=begin_epoch, num_epoch=end_epoch) File "/usr/local/lib/python2.7/dist-packages/mxnet-0.7.0-py2.7.egg/mxnet/module/base_module.py", line 337, in fit allow_missing=allow_missing, force_init=force_init) File "/home/yf/mx-rcnn/rcnn/module.py", line 95, in init_params force_init=force_init) File "/usr/local/lib/python2.7/dist-packages/mxnet-0.7.0-py2.7.egg/mxnet/module/module.py", line 190, in init_params _impl(name, arr, arg_params) File "/usr/local/lib/python2.7/dist-packages/mxnet-0.7.0-py2.7.egg/mxnet/module/module.py", line 183, in _impl raise RuntimeError("%s is not presented" % name) RuntimeError: conv2_1_bias is not presented

ijkguo commented 7 years ago

The vgg symbol need a parameter conv2_1_bias which is not presented if you use resnet model. You might want to change the symbol to a resnet one.

ijkguo commented 7 years ago

I would refer you to https://github.com/tornadomeet/mx-rcnn/blob/master/rcnn/resnet.py for a good one.

ijkguo commented 7 years ago

Checkout ResNet support.