zimoqingfeng/UMOP

question about retinanet_sum.log

Closed this issue · 1 comments

This work is really a great work,I admire you very much.
I run this training process with tt100k dataset ( coco format,45 classes,input size:1024×1024 ,6105 pictures) ,
change
num_pos_samples = torch.tensor(len(lvl_valid_labels[lvl_valid_labels != 80]),
dtype=torch.float,
device=lvl_valid_labels.device)
to
num_pos_samples = torch.tensor(len(lvl_valid_labels[lvl_valid_labels != 45]),
dtype=torch.float,
device=lvl_valid_labels.device)

and output a file retinanet_sum.log.Output as follows:
0 6631380.0 27.0
1 1658880.0 0.0
2 414720.0 0.0
3 103680.0 0.0
4 25920.0 0.0
0 6635520.0 9.0
1 1658880.0 0.0
2 414720.0 0.0
3 103680.0 0.0
4 25920.0 0.0
0 6635520.0 15.0
1 1658880.0 0.0
2 414720.0 0.0
3 103680.0 0.0
4 25920.0 0.0
0 6632280.0 36.0
1 1657980.0 5.0
2 414720.0 0.0
3 103680.0 0.0
4 25920.0 0.0
…………

I want to know does this 0,1,,2,3,4 mean in FPN features from P3 to P7 .I found that they are repeat every 5 lines. I want to know if it's meaning that in P3 ,the number of total valid samples is 6635520.0 and number of positive samples is 27.0.
In P4, the number of total valid samples is 1658880.0 and the number of positive samples is 0.0.
In P5, the number of total valid samples is 414720.0 and the number of positive samples is 0.0.
In P6, the number of total valid samples is 103680.0 and the number of positive samples is 0.0.
In P7, the number of total valid samples is 25920.0 and the number of positive samples is 0.0.
I calculate by hand in P3,1024×1024 input,downsample 8 times,every pixel with 9 anchors,output 45 feature maps for 45 classes,that is,(1024÷8)×(1024÷8)×9×45=6635520,same with the data above.
To be honest,I am a rookie,I did not understand your code, so I can only guess these.
And I am also interested in how does this calculate the number of positive samples in P3 to P7.

label_weights
lvl_valid_labels = labels[label_weights != 0]
lvl_valid_labels[lvl_valid_labels != 80]

https://github.com/zimoqingfeng/UMOP/blob/master/mmdet/models/dense_heads/anchor_head.py#L405

I want to know what does these mean.

If possible,I hope you can explain the code during calculate positive samples.
Thank you for your answer.Look forward to your reply.Thank you.

Thx for your attention.
Maybe you could change 80 to 45 at https://github.com/zimoqingfeng/UMOP/blob/master/mmdet/models/dense_heads/anchor_head.py#L412, because 80 classes for COCO dataset, and ur data have 45 classes.