vasgaowei / pytorch_MELM

The pytorch implementation of the Min-Entropy Latent Model for Weakly Supervised Object Detection
104 stars 19 forks source link

The CorLoc of this code #19

Closed zwy1996 closed 3 years ago

zwy1996 commented 4 years ago

hello, I am sorry to bother you again, When I used this code, I found I can't test the CorLoc metric, could you tell me about this? Thank you very much.

vasgaowei commented 4 years ago

I will upload some codes later. Thank you.

zwy1996 commented 4 years ago

Thanks, When I used this code to train on the voc2012 trainval dataset, I got the following error, did you know why? Thank you !(ps: I didn't meet the error on voc 2007 trainval).

Traceback (most recent call last): File "./tools/trainval_net.py", line 134, in max_iters=args.max_iters) File "/home/ai-server/disk1/zwy/code/pytorch_MELM-master_fix_weight_relu/tools/../lib/model/train_val.py", line 401, in train_net sw.train_model(max_iters) File "/home/ai-server/disk1/zwy/code/pytorch_MELM-master_fix_weight_relu/tools/../lib/model/train_val.py", line 314, in train_model summary_val = self.net.get_summary(blobs_val) File "/home/ai-server/disk1/zwy/code/pytorch_MELM-master_fix_weight_relu/tools/../lib/nets/network.py", line 714, in get_summary self.forward(blobs['data'], blobs['image_level_labels'], blobs['im_info'], blobs['gt_boxes'], blobs['ss_boxes']) File "/home/ai-server/disk1/zwy/code/pytorch_MELM-master_fix_weight_relu/tools/../lib/nets/network.py", line 656, in forward self._add_losses() # compute losses File "/home/ai-server/disk1/zwy/code/pytorch_MELM-master_fix_weight_relu/tools/../lib/nets/network.py", line 253, in _add_losses self._image_gt_summaries['image_level_label']) File "/home/ai-server/disk1/zwy/code/pytorch_MELM-master_fix_weight_relu/tools/../lib/nets/network.py", line 392, in get_refine_supervision overlaps = bbox_overlaps(ss_boxes[:,1:], max_score_box) File "/home/ai-server/disk1/zwy/code/pytorch_MELM-master_fix_weight_relu/tools/../lib/utils/bbox.py", line 23, in bbox_overlaps query_areas = (query_boxes[:, 2] - query_boxes[:, 0] + 1) * \ IndexError: too many indices for tensor of dimension 1

vasgaowei commented 4 years ago

I guess the is the shape of max_score_box, you can reshape max_score_box to np.reshape(max_score_box, [-1,4])

zwy1996 commented 4 years ago

Hello, thanks for your answer, I have tried this, but it had no effect and I met the above error. Now, I know this error is because the vco2012 test dataset has no label, so the max_score_box is none and got the above error, thank you for your good work. I have another question about the corloc metric, I have seen you upload the test corloc code and you deleted this later, would you mind sending the code to my e-mail? So we can fix the problem together. Thank you very much about your excellent work! My e-mail is 2868708795@qq.com.

vasgaowei commented 4 years ago

Oh, yeah, for voc_2012_test, you should upload your detected results to the server for evaluation. And I will send you the code. In fact, the CorLoc.py file is correct, but the pascal_voc.py should also be modified a little.