Megvii-BaseDetection / DeFCN

End-to-End Object Detection with Fully Convolutional Network
Apache License 2.0
495 stars 36 forks source link

Problem with using ( # no center sampling, it will use all the locations within a ground-truth box) #8

Closed b03505036 closed 3 years ago

b03505036 commented 3 years ago

It quite easy appears "nan" in the box_delta when not using center sampling. Is it an normal state? or something what I miss? Thank for your great work

b03505036 commented 3 years ago

To be more specific, with or without using the center sampling, the number of positive and negative are the same. But, I can't figure out why it cause 'nan' when using no center sampling.

Defined in get_ground_truth if self.center_sampling_radius > 0: centers = gt_boxes.get_centers() is_in_boxes = [] for stride, shifts_i in zip(self.fpn_strides, shifts_per_image): radius = stride * self.center_sampling_radius center_boxes = torch.cat(( torch.max(centers - radius, gt_boxes.tensor[:, :2]), torch.min(centers + radius, gt_boxes.tensor[:, 2:]), ), dim=-1) center_deltas = self.shift2box_transform.get_deltas( shifts_i, center_boxes.unsqueeze(1)) is_in_boxes.append(center_deltas.min(dim=-1).values > 0) is_in_boxes = torch.cat(is_in_boxes, dim=1) else:

no center sampling, it will use all the locations within a ground-truth box

            **is_in_boxes = deltas.min(dim=-1).values > 0**
wjfwzzc commented 3 years ago

Already solved on the other platform. Close it.