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

Untrained parameter problem #3

Closed
Breeze-Zero opened this issue Apr 8, 2024 · 2 comments
Closed

Untrained parameter problem #3

Breeze-Zero opened this issue Apr 8, 2024 · 2 comments

Comments

@Breeze-Zero
Copy link

AdaIR/net/model.py

Lines 339 to 347 in 69e13fb

x = self.conv1(x)
mask = torch.zeros(x.shape).to(x.device)
h, w = x.shape[-2:]
threshold = F.adaptive_avg_pool2d(x, 1)
threshold = self.rate_conv(threshold).sigmoid()
for i in range(mask.shape[0]):
h_ = (h//n * threshold[i,0,:,:]).int()
w_ = (w//n * threshold[i,1,:,:]).int()

I found a problem, since I was training with DDP, that would indicate the presence of parameters that were not involved in the training. Through my investigation, self.score_gen and self.conv are unnecessary, and these problems are not serious. But the most important thing is that self.rate_conv will not participate in the gradient calculation, because the operation of generating mask with threshold is not differentiable.

@c-yn
Copy link
Owner

c-yn commented Apr 8, 2024

Hi, thanks for your interest.

self.score_gen and self.conv are not used in our models, and we forget to delete them in our code.
And thank you for pointing out the gradient-related issue. We will delve into it.

@c-yn c-yn closed this as completed Apr 8, 2024
@sentinel8b
Copy link

I think gradient issue of self.rate_conv is crucial, do you have specific plan or milestone to fix it out?

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

3 participants