That’s because the size 0 box has width of 0, which leads to inf for torch.log(gt_widths / ex_widths).
I have the same question as how to deal with images without objects. Is there any standard process? Shall we 1. filter out images without desired objects; or 2. is there a smart way for that?