Skip to content

LightGlue Params #48

Closed Answered by fabio-sim
DiZhang980 asked this question in Q&A
Nov 2, 2023 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

Hi @DiZhang980, thank you for your interest in LightGlue-ONNX.

Assuming you mean each transformer layer, you can add this print statement:

print(f"Layer {i+1}: {sum(p.numel() for p in self.transformers[i].parameters())} parameters")

to the following loop:

for i in range(self.conf.n_layers):
# self+cross attention
desc0, desc1 = self.transformers[i](desc0, desc1, encoding0, encoding1)

I get the following output:

Layer 1: 1250560 parameters
Layer 2: 1250560 parameters
Layer 3: 1250560 parameters
Layer 4: 1250560 parameters
Layer 5: 1250560 parameters
Layer 6: 1250560 parameters
Layer 7: 125056…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@DiZhang980
Comment options

Answer selected by fabio-sim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants