sanghoon / pva-faster-rcnn

Demo code for PVANet
https://arxiv.org/abs/1611.08588
Other
651 stars 241 forks source link

train my data with pva(2 categories) #25

Open jsjs0827 opened 7 years ago

jsjs0827 commented 7 years ago

@sanghoon dear sanghoon,I got a problem in training my own data with your pva-frcnn.When I use example_train_384,my modification: train.prototxt line11 num_classes : 21 to 2 line6511 num_output84 to 8(When I change this,the train.py can't run) .Check failed: bottom[0]->channels() == bottom[1]->channels() (8 vs. 84) just keep the 84,when the iteration goes to 9980,then: File "./tools/train_net.py", line 112, in max_iters=args.max_iters) File "/home/amax/JS/20161123/pva-faster-rcnn/tools/../lib/fast_rcnn/train.py", line 160, in train_net model_paths = sw.train_model(max_iters) File "/home/amax/JS/20161123/pva-faster-rcnn/tools/../lib/fast_rcnn/train.py", line 111, in train_model model_paths.append(self.snapshot()) File "/home/amax/JS/20161123/pva-faster-rcnn/tools/../lib/fast_rcnn/train.py", line 73, in snapshot self.bbox_stds[:, np.newaxis]) ValueError: operands could not be broadcast together with shapes (84,4096) (8,1) I trained fasterrcnn(vgg,rfcn) before. What should I do?

catsdogone commented 7 years ago

Did you changed the layer name? If not, you should try.

ck196 commented 7 years ago

In train.prototxt, you need to change num_output in bbox_pred layer. num_output = num_classes * 4

Note: You train with 2 categories, so num_classes should be 3.

layer {
   name: "bbox_pred"
   type: "InnerProduct"
   bottom: "fc7"
   top: "bbox_pred"
   param { lr_mult: 1.0 decay_mult: 1.0 }
   param { lr_mult: 2.0 decay_mult: 0 }
   inner_product_param {
     num_output: 8 # 2 * 4 - it should be 3 * 4
     weight_filler { type: "gaussian" std: 0.001 }
     bias_filler { type: "constant" value: 0 }
   }
}
MyVanitar commented 7 years ago

@ck196 Please help me on this #63

MyVanitar commented 7 years ago

@catsdogone Please help me on this #63