62 字
1 分钟
输出网络参数和网络结构

输出网络参数和网络结构#

1、 输出网络参数#

print("\n\nprint the each layer's name(GAB)")
for name in G_AB.state_dict():
print(name)
print("\n\nprint the name and the size of layers")
for name,parameters in G_AB.named_parameters():
print(name,";",parameters.size())
print("\n\nsave the parameters")
for layer in ['model.1.freq','model.1.theta','model.1.sigma','model.1.psi','model.1.x','model.1.y','model.1.weight']:
print("\n",layer)
print(G_AB.state_dict()[layer])
G_AB.state_dict()[layer].cpu().detach().numpy().tofile(layer[8:]+'.rsf@')

2、输出网络结构#

from torchinfo import summary
summary(G_AB,input_size=(16,1,256,256))
输出网络参数和网络结构
https://tuoyuangui.github.io/website/posts/typora/深度学习/输出中间参数和网络结构/
作者
椭圆规/tuoyuangui
发布于
2023-12-12
许可协议
CC BY-NC-SA 4.0