Skip to content

Commit

Permalink
check the model info
Browse files Browse the repository at this point in the history
  • Loading branch information
yux-lab committed Mar 2, 2025
1 parent c96313c commit 4ac582a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pix2tex/model/checkpoints/model_info.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import torch

pth_file_path = "weights.pth"

# load
state_dict = torch.load(pth_file_path, map_location=torch.device('cpu'))

# print
# print("Model parameters:")
# for key, value in state_dict.items():
# print(f"{key}: {value.shape}")
total_params = sum(value.numel() for value in state_dict.values())
print(f"Total number of parameters: {total_params}")

0 comments on commit 4ac582a

Please sign in to comment.