MCG-NJU / SparseBEV

[ICCV 2023] SparseBEV: High-Performance Sparse 3D Object Detection from Multi-Camera Videos
https://arxiv.org/abs/2308.09244
MIT License
306 stars 21 forks source link

self.init_query_bbox = nn.Embedding(self.num_query, 10) . This parameter doesn't seem to have been updated. #60

Closed zbaishancha closed 3 months ago

zbaishancha commented 3 months ago

Hello dear author, thank you very much for your open source work and your promptness in answering questions. I was looking at your code and found this problem as follows: image

During each forward, the query bbox is using self.init_query_box.weight.clone, and by doing so it seems that the parameters of self.init_query_box will not be updated, so what is the significance of setting self.init_query_box to nn.Embedding?

zbaishancha commented 3 months ago

@afterthat97 Best wishes to you :)

afterthat97 commented 3 months ago

Note that clone != detach, so the gradient will still be propagated to init_query_box.weight

zbaishancha commented 3 months ago

Sorry, I may have misunderstood, I thought that after clone, query bbox and self.init_query_box.weight are two different variables (occupying different memory addresses despite having the same value). So, even though thequery bbox is involved in budgeting the gradient in the decoder layer, the gradient doesn't seem to trickle down to init_query_box.weight?

zbaishancha commented 3 months ago

Also, I tried to experiment and found that self.init_query_box.weight doesn't seem to change after each forward and backward.

zbaishancha commented 3 months ago

@afterthat97

zbaishancha commented 3 months ago

sry, my understanding was wrong and I am very sorry for the trouble!