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

The original SuperpointNet training don't work #108

Open
AndreGao08 opened this issue Dec 1, 2023 · 1 comment
Open

The original SuperpointNet training don't work #108

AndreGao08 opened this issue Dec 1, 2023 · 1 comment

Comments

@AndreGao08
Copy link

When I try to train a original SuperpointNet(without batch normal), but the training results will not converge. Is there any parameter I need to modified?
image


Here is my code:

# Shared Encoder.
self.conv1a = torch.nn.Conv2d(1, c1, kernel_size=3, stride=1, padding=1)
self.conv1b = torch.nn.Conv2d(c1, c1, kernel_size=3, stride=1, padding=1)
self.conv2a = torch.nn.Conv2d(c1, c2, kernel_size=3, stride=1, padding=1)
self.conv2b = torch.nn.Conv2d(c2, c2, kernel_size=3, stride=1, padding=1)
self.conv3a = torch.nn.Conv2d(c2, c3, kernel_size=3, stride=1, padding=1)
self.conv3b = torch.nn.Conv2d(c3, c3, kernel_size=3, stride=1, padding=1)
self.conv4a = torch.nn.Conv2d(c3, c4, kernel_size=3, stride=1, padding=1)
self.conv4b = torch.nn.Conv2d(c4, c4, kernel_size=3, stride=1, padding=1)
# Detector Head.
self.convPa = torch.nn.Conv2d(c4, c5, kernel_size=3, stride=1, padding=1)
self.convPb = torch.nn.Conv2d(c5, det_h, kernel_size=1, stride=1, padding=0)
# Descriptor Head.
self.convDa = torch.nn.Conv2d(c4, c5, kernel_size=3, stride=1, padding=1)
self.convDb = torch.nn.Conv2d(c5, d1, kernel_size=1, stride=1, padding=0)

def forward(self, x,):
# Shared Encoder.
x = self.relu(self.conv1a(x))
x = self.relu(self.conv1b(x))
x,ind1 = self.pool(x)
x = self.relu(self.conv2a(x))
x = self.relu(self.conv2b(x))
x,ind2 = self.pool(x)
x = self.relu(self.conv3a(x))
x = self.relu(self.conv3b(x))
x,ind3= self.pool(x)
x = self.relu(self.conv4a(x))
x = self.relu(self.conv4b(x))
# Detector Head.
cPa = self.relu(self.convPa(x))
semi = self.convPb(cPa)

  # Descriptor Head.
  cDa = self.relu(self.convDa(x))
  desc = self.convDb(cDa)
  dn = torch.norm(desc, p=2, dim=1) # Compute the norm.
  desc = desc.div(torch.unsqueeze(dn, 1)) # Divide by norm to normalize.
  out={'semi': semi, 'desc': desc}
  return out
@jjn037
Copy link

jjn037 commented Aug 30, 2024

add one

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