Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reg_branches为什么计算了两遍呢? #15

Open
kouyuanbo opened this issue Apr 28, 2024 · 2 comments
Open

reg_branches为什么计算了两遍呢? #15

kouyuanbo opened this issue Apr 28, 2024 · 2 comments

Comments

@kouyuanbo
Copy link

我发现在decoder中,已经使用reg_branches对decoder的中间特征回归过一次了,并且把回归的结果输出了,就是intermediate_reference_points。而在ars_detr_head.py文件的forward函数中,当获取transofrmer的输出后,使用reg_branches对decoder的输出的中间特征又计算了一次回归,然后将两次回归的结果加起来了。请问这样做是为什么呢?

@httle
Copy link
Owner

httle commented May 7, 2024

因为decoder里做的那个回归之后有个detach的操作,这时候梯度是不传导的,所以获得了transformer的输出之后会再计算一次然后加上前一层detach的结果,这一部分操作在原先的Deformable DETR里也有你可以参考一下。

@kouyuanbo
Copy link
Author

因为decoder里做的那个回归之后有个detach的操作,这时候梯度是不传导的,所以获得了transformer的输出之后会再计算一次然后加上前一层detach的结果,这一部分操作在原先的Deformable DETR里也有你可以参考一下。

谢谢回复!原来是梯度的问题。是的我在代码中也看到了Rotated Deformable DETR的代码,请问这个代码是您自己实现的吗?AO2-DETR中也实现了Rotated Deformable DETR的实现代码,不过与您的代码实现有一些不同

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants