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

dimension mismatch in test evaluation #7

Closed
polo5 opened this issue Jun 7, 2018 · 3 comments
Closed

dimension mismatch in test evaluation #7

polo5 opened this issue Jun 7, 2018 · 3 comments

Comments

@polo5
Copy link

polo5 commented Jun 7, 2018

The code to evaluate the test mAP fails due to a factor of 10 mismatch in the ground truth and model scores

Evaluating on test set:

File "src/train_cls.py", line 169, in <module>
    ap = metrics.average_precision_score(gts[i][gts[i]<=1], scr[i][gts[i]<=1]-1e-5*gts[i][gts[i]<=1])
IndexError: boolean index did not match indexed array along dimension 0; dimension is 49520 but corresponding boolean dimension is 4952

Evaluating on val set:

  File "src/train_cls.py", line 169, in <module>
    ap = metrics.average_precision_score(gts[i][gts[i]<=1], scr[i][gts[i]<=1]-1e-5*gts[i][gts[i]<=1])
IndexError: boolean index did not match indexed array along dimension 0; dimension is 25100 but corresponding boolean dimension is 2510

Here the ground truths are shape (20, X) but the scores are (20, X*10). I'm running on python 2.
My test_resize_layer.cpp failed in the 'make test' compiling so I removed it. Perhaps this is causing those shape mismatches now? Thanks for any tips.

@polo5
Copy link
Author

polo5 commented Jun 7, 2018

After further investigation it seems that each row in r['fc8'] is equal, and keeping only the first row fixes the shape mismatch. This is done by changing the folowing line:

#scr.append(1 * r['fc8'])
scr.append(1*np.expand_dims(r['fc8'][0], axis=0)) # (10,20) -> (1,20)

For 1 crop only the code runs without errors but produces poor mAP results (order of 3%), which is much lower than the 53% you get by random guessing...

@polo5
Copy link
Author

polo5 commented Jun 9, 2018

Nevermind, this is what happens if you give a (faulty?) deploy.prototxt as input as opposed to a train.prototxt. If you're looking for a working example have a look here: https://github.com/jeffdonahue/bigan

@polo5 polo5 closed this as completed Jun 9, 2018
@jianghaojun
Copy link

@polo5 Did you solve the mismatch problem? I spent a lot of days debugging the code but failed. The jeffdonahue/bigan code has same problem. Besides, my test_resize_layer.cpp also failed in the 'make test' compiling.
Help,please.

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

2 participants