vasgaowei / pytorch_MELM

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

cross_entropy=0, loss_box=0 #10

Closed Spark001 closed 5 years ago

Spark001 commented 5 years ago

I follow your step to train a vgg16 WSOD model, but get cross_entropy=0 and loss_box=0 from the tensorboard. Furthermore, the detection mAP I got was only 40.25%:

AP for aeroplane = 0.5127
AP for bicycle = 0.5598
AP for bird = 0.3524
AP for boat = 0.2071
AP for bottle = 0.1507
AP for bus = 0.6139
AP for car = 0.6589
AP for cat = 0.3212
AP for chair = 0.1487
AP for cow = 0.4756
AP for diningtable = 0.2165
AP for dog = 0.4216
AP for horse = 0.3439
AP for motorbike = 0.6621
AP for person = 0.0943
AP for pottedplant = 0.1811
AP for sheep = 0.4907
AP for sofa = 0.4062
AP for train = 0.6274
AP for tvmonitor = 0.6053
Mean AP = 0.4025

the classification AP is as follow:

AP for aeroplane = 0.9760
AP for bicycle = 0.9668
AP for bird = 0.9578
AP for boat = 0.9417
AP for bottle = 0.7712
AP for bus = 0.9181
AP for car = 0.9706
AP for cat = 0.9628
AP for chair = 0.7361
AP for cow = 0.9004
AP for diningtable = 0.8104
AP for dog = 0.9484
AP for horse = 0.9580
AP for motorbike = 0.9435
AP for person = 0.9875
AP for pottedplant = 0.7991
AP for sheep = 0.9106
AP for sofa = 0.7590
AP for train = 0.9622
AP for tvmonitor = 0.9072

Did I do something wrong? Could you give me your advice? Thanks.

vasgaowei commented 5 years ago
  1. My code is based on faster-rcnn, so the "cross_entropy" , the "loss_box" , "rpn_cross_entropy", "rpn_loss_box" are defined in faster-rcnn. I'm sorry I didn't delete these codes. And in network.py, you can delete these four lines of code: self._losses['cross_entropy'] = np.zeros(1) self._losses['loss_box'] = np.zeros(1) self._losses['rpn_cross_entropy'] = np.zeros(1) self._losses['rpn_loss_box'] = np.zeros(1)
  2. Maybe during training, you just used 500 proposals. So I recommend using 1000 randomly choosed proposals. You can do this by some modifications to the codes in network.py. def return_ss_boxes(self, boxes_index, mode='TRAIN'): if mode == 'TEST': return boxes_index box_num = min(500, len(boxes_index)) indexes = np.random.choice(boxes_index, size=box_num, replace=False) return indexes Changing 500 to 1000 so training using 1000 proposals.
Spark001 commented 5 years ago

Thanks a lot !