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

TypeError: 'numpy.float64' object cannot be interpreted as an index #10

Open
CuiYiZe opened this issue Jun 30, 2017 · 2 comments
Open

Comments

@CuiYiZe
Copy link

CuiYiZe commented Jun 30, 2017

As i run the train.sh
i met this issue:

File "/home/cui/adversarial-frcnn/tools/../lib/roi_data_layer/minibatch.py", line 343, in _sample_rois
fg_inds, size=fg_rois_per_this_image, replace=False)
File "mtrand.pyx", line 1187, in mtrand.RandomState.choice (numpy/random/mtrand/mtrand.c:18864)
TypeError: 'numpy.float64' object cannot be interpreted as an index

And when i follow some answers to set the numpy to 1.11.0 it solved but appearance another issue.
image

And some answers tell me to upgrade the numpy .
SO, what should i do ?
Thanks very much !!!

@Kongsea
Copy link

Kongsea commented Feb 8, 2018

Add .astype(np.int) to the original code in lib/roi_data_layer/minibatch.py to change it to:
fg_rois_per_this_image = np.minimum(fg_rois_per_image, fg_inds.size).astype(np.int)

@LinlyAC
Copy link

LinlyAC commented Mar 30, 2018

@CuiYiZe @Kongsea Hello, do you solve this problem? I also meet this error. So sad.
No matter which version I choose, I will encounter the same situation as @CuiYiZe .
I also try @Kongsea method, but I got this problem:
(numpy==1.11.0)
1 11

(numpy==1.14.0)
1

Can someone help me? thank you very much!

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

3 participants