Closed zbaishancha closed 3 months ago
@afterthat97 Best wishes to you :)
Note that clone
!= detach
, so the gradient will still be propagated to init_query_box.weight
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
?
Also, I tried to experiment and found that self.init_query_box.weight doesn't seem to change after each forward and backward.
@afterthat97
sry, my understanding was wrong and I am very sorry for the trouble!
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](https://github.com/MCG-NJU/SparseBEV/assets/106945649/89578e60-9208-47ab-8f05-047ad63ce76d)
During each forward, the
query bbox
is usingself.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?