Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

training error #45

Open
sandeepangara opened this issue Feb 4, 2017 · 6 comments
Open

training error #45

sandeepangara opened this issue Feb 4, 2017 · 6 comments

Comments

@sandeepangara
Copy link

sandeepangara commented Feb 4, 2017

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
Copy link

nashory commented Feb 15, 2017

I have the same problem.
Anyone solved?

@Timonzimm
Copy link
Contributor

Followed the solution presented here: rbgirshick/py-faster-rcnn#481
pip install -U numpy==1.11.0

It personally worked perfectly afterwards.

@Jiaming-Liu
Copy link

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

@muyue1238
Copy link

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:rbgirshick/py-faster-rcnn#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
Copy link

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

@wander1985
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants