adversarial-frcnn
adversarial-frcnn copied to clipboard
TypeError: 'numpy.float64' object cannot be interpreted as an index
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.
And some answers tell me to upgrade the numpy . SO, what should i do ? Thanks very much !!!
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)
@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)
(numpy==1.14.0)
Can someone help me? thank you very much!