adversarial-frcnn icon indicating copy to clipboard operation
adversarial-frcnn copied to clipboard

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

Open CuiYiZe opened this issue 7 years ago • 2 comments

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 !!!

CuiYiZe avatar Jun 30 '17 10:06 CuiYiZe

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)

Kongsea avatar Feb 08 '18 03:02 Kongsea

@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!

LinlyAC avatar Mar 30 '18 08:03 LinlyAC