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

./lib/datasets/voc_eval.py BB = BB [sorted_ind, :] IndexError: too many indices

Open fbi0817 opened this issue 8 years ago • 1 comments

Hi @Orpine , I want to train my own dataset with one target, which is just a binary classification problem. I modify the prototxt in /models/pascal_voc/ResNet-50/rfcn_alt_opt_5step_ohem/ and change each cls-num from 21 to 2, then I run the ./experiments/scripts/frcn_alt_opt_5stage_ohem.sh 0 ResNet-50 pascal_voc. The training is very successful and the loss seems to decrease, while in the test_net.py, I meet the error:

./lib/datasets/voc_eval.py BB = BB [sorted_ind, :] IndexError: too many indices

and I try to print the value of BB and sorted_ind, and both of them seems empty I am wondering how to solve the problem, and can anyone give me some hints on how to solve the problem?

fbi0817 avatar Dec 04 '16 03:12 fbi0817

Maybe you can add the following line before BB = BB[sorted_ind, :] in voc_eval.py if sorted_ind.size > 0:. this "if" statement should encompass from line 149 to 195. Then add the following line from line 196: else: fp = 0 tp = 0 rec = 0

This solution should skip the error message, but I am not sure if it would affect the test results.

wander1985 avatar Jun 25 '19 21:06 wander1985