dbolya / tide

A General Toolbox for Identifying Object Detection Errors
https://dbolya.github.io/tide
MIT License
702 stars 115 forks source link

float division by zero Error in td.plot and td.summarize when all errors are 0 and maps are 0 #16

Closed djaym7 closed 3 years ago

djaym7 commented 3 years ago
in validate(net, val_data, ctx, eval_metric) 37 if mean_ap[-1]>0.001: 38 td.summarize() ---> 39 td.plot() 40 return map_name,mean_ap ~/SageMaker/PICV/Segmentation Job2/tide_metric.py in plot(self) 20 return self.tide.summarize() 21 def plot(self): ---> 22 self.tide.plot() 23 def update(self, pred_bboxes, pred_labels, pred_scores, 24 gt_bboxes, gt_labels): ~/anaconda3/envs/mxnet_p36/lib/python3.6/site-packages/tidecv/quantify.py in plot(self, out_dir) 588 # Do the plotting now 589 for run_name, run in self.runs.items(): --> 590 self.plotter.make_summary_plot(out_dir, errors, run_name, run.mode, hbar_names=True) 591 592 ~/anaconda3/envs/mxnet_p36/lib/python3.6/site-packages/tidecv/plotting.py in make_summary_plot(self, out_dir, errors, model_name, rec_type, hbar_names) 118 error_types = list(errors['main'][model_name].keys()) + list(errors['special'][model_name].keys()) 119 error_sum = sum([e for e in errors['main'][model_name].values()]) --> 120 error_sizes = [e / error_sum for e in errors['main'][model_name].values()] + [0, 0] 121 fig, ax = plt.subplots(1, 1, figsize=(11, 11), dpi=high_dpi) 122 patches, outer_text, inner_text = ax.pie(error_sizes, colors=self.colors_main.values(), labels=error_types, ~/anaconda3/envs/mxnet_p36/lib/python3.6/site-packages/tidecv/plotting.py in (.0) 118 error_types = list(errors['main'][model_name].keys()) + list(errors['special'][model_name].keys()) 119 error_sum = sum([e for e in errors['main'][model_name].values()]) --> 120 error_sizes = [e / error_sum for e in errors['main'][model_name].values()] + [0, 0] 121 fig, ax = plt.subplots(1, 1, figsize=(11, 11), dpi=high_dpi) 122 patches, outer_text, inner_text = ax.pie(error_sizes, colors=self.colors_main.values(), labels=error_types, ZeroDivisionError: float division by zero
PaulZhangIsing commented 3 years ago

I found the same error, I suspect is my addtion data got problem. I replace the dummy example like this, but it still occurs tide.evaluate(datasets.COCO(), datasets.COCO(), mode=TIDE.BOX)

PaulZhangIsing commented 3 years ago

Usually it is because the detection has no overlap with the groundtruth, therefore we have such error

djaym7 commented 3 years ago

closed since I am no longer using this