YuwenXiong / py-R-FCN

R-FCN with joint training and python support
MIT License
1.05k stars 472 forks source link

training error #45

Open sandeepangara opened 7 years ago

sandeepangara commented 7 years ago

Hello,

While training I am getting the following error

I0204 03:08:08.855443 21819 solver.cpp:228] Iteration 920, loss = 0.266415 I0204 03:08:08.855478 21819 solver.cpp:244] Train net output #0: accuarcy = 0.941176 I0204 03:08:08.855485 21819 solver.cpp:244] Train net output #1: loss_bbox = 0.000348185 ( 1 = 0.000348185 loss) I0204 03:08:08.855489 21819 solver.cpp:244] Train net output #2: loss_cls = 0.202786 ( 1 = 0.202786 loss) I0204 03:08:08.855494 21819 solver.cpp:244] Train net output #3: rpn_cls_loss = 0.0552239 ( 1 = 0.0552239 loss) I0204 03:08:08.855497 21819 solver.cpp:244] Train net output #4: rpn_loss_bbox = 0.0136765 ( 1 = 0.0136765 loss) I0204 03:08:08.855501 21819 sgd_solver.cpp:106] Iteration 920, lr = 0.001 Traceback (most recent call last): File "./tools/train_net.py", line 112, in max_iters=args.max_iters) File "/home/sandeep/workspace/py-R-FCN/tools/../lib/fast_rcnn/train.py", line 205, in train_net model_paths = sw.train_model(max_iters) File "/home/sandeep/workspace/py-R-FCN/tools/../lib/fast_rcnn/train.py", line 146, in train_model self.solver.step(1) File "/home/sandeep/workspace/py-R-FCN/tools/../lib/rpn/proposal_target_layer.py", line 66, in forward rois_per_image, self._num_classes) File "/home/sandeep/workspace/py-R-FCN/tools/../lib/rpn/proposal_target_layer.py", line 185, in _sample_rois fg_inds = npr.choice(fg_inds, size=fg_rois_per_this_image, replace=False) File "mtrand.pyx", line 1176, in mtrand.RandomState.choice (numpy/random/mtrand/mtrand.c:18822) TypeError: 'numpy.float64' object cannot be interpreted as an index

Please help me...

Thanks in advance

nashory commented 7 years ago

I have the same problem. Anyone solved?

Timonzimm commented 7 years ago

Followed the solution presented here: https://github.com/rbgirshick/py-faster-rcnn/issues/481 pip install -U numpy==1.11.0

It personally worked perfectly afterwards.

Jiaming-Liu commented 7 years ago

ImportError: numpy.core.multiarray failed to import after running pip install -U numpy==1.11.0

muyue1238 commented 6 years ago

I ran into this same problem, too. Have to say I got tortured by this problem for near two weeks, and the solution is atually quiet simple. I refered to the following question:https://github.com/rbgirshick/py-faster-rcnn/issues/626 . It turns out that numpy-1.13 doesn't support flaot and you have to change some parameters into int. And the wrong parameters will be pointed out in error code, in this case, line 66 and line 185 in proposal_target_layer.py are wrong. After you changed it, you maybe ran into another error in diffrent places, just change them all, and it will finally work. BTW, back-up the files you are going to change incase something went wrong. Hope this will help.

starxhong commented 6 years ago

rbgirshick/py-faster-rcnn#481 gives two ways to solve the problem perfectly w./wo. reinstall numpy

wander1985 commented 5 years ago

I've got similar error. By changing fg_rois_per_this_image = min(fg_rois_per_image, fg_inds.size) to fg_rois_per_this_image = np.int64(min(fg_rois_per_image, fg_inds.size)) in line 182 in proposal_target_layer.py works for me.

Hope this would help.