py-R-FCN icon indicating copy to clipboard operation
py-R-FCN copied to clipboard

training error

Open sandeepangara opened this issue 8 years ago • 6 comments

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

sandeepangara avatar Feb 04 '17 09:02 sandeepangara

I have the same problem. Anyone solved?

nashory avatar Feb 15 '17 12:02 nashory

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.

Timonzimm avatar Apr 10 '17 15:04 Timonzimm

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

Jiaming-Liu avatar Jul 26 '17 23:07 Jiaming-Liu

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.

muyue1238 avatar Dec 11 '17 02:12 muyue1238

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

starxhong avatar Mar 09 '18 05:03 starxhong

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.

wander1985 avatar Jun 25 '19 18:06 wander1985