File size: 520 Bytes
d77de10
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import torch

# Load the state dictionary from the .pth file
model_path = './checkpoints/artgan_pix2pix/latest_net_G.pth'
state_dict = torch.load(model_path, map_location=torch.device('cpu'))

# Print statistics about the weights
for name, param in state_dict.items():
    print(f"Layer: {name}")
    print(f"\tShape: {param.shape}")
    print(f"\tMean: {param.mean().item()}")
    print(f"\tStandard Deviation: {param.std().item()}")
    print(f"\tMin: {param.min().item()}")
    print(f"\tMax: {param.max().item()}")