ReDet icon indicating copy to clipboard operation
ReDet copied to clipboard

max() arg is an empty sequence

Open bigFatCatTom opened this issue 2 years ago • 3 comments

我在训练自己数据集的时候, 出现: .../ReDet/mmdet/core/bbox/transforms_rbbox.py", line 567, in mask2poly_single max_contour = max(contours, key=len) ValueError: max() arg is an empty sequence。 这是我在制作数据局的过程中有什么忽视掉的地方么。

bigFatCatTom avatar Jan 06 '22 07:01 bigFatCatTom

可能存在尺寸比较小的object,可以在dataset中加入尺寸判断: https://github.com/csuhan/ReDet/blob/0b9addf3c2734659fd6ffc7824f2e659fde4419c/mmdet/datasets/DOTA2.py#L130-L132

或者在dataset中判断mask_to_counter是否成功,对无法生成contour的object进行过滤,参考: https://github.com/csuhan/ReDet/blob/0b9addf3c2734659fd6ffc7824f2e659fde4419c/mmdet/core/bbox/transforms_rbbox.py#L557-L574

csuhan avatar Jan 06 '22 15:01 csuhan

Hai @bigFatCatTom , I am getting the same error while trying to train ReDet on VisDrone dataset. Did you solve this issue? Please let me know.

Sairam13001 avatar Jan 10 '22 04:01 Sairam13001

Hai @bigFatCatTom , I am getting the same error while trying to train ReDet on VisDrone dataset. Did you solve this issue? Please let me know.

You can refer to the author's answer above

bigFatCatTom avatar Jan 12 '22 08:01 bigFatCatTom