读pkl文件,并打印出每行的权重

import torch
from test01 import Net

model = Net()
model.load_state_dict(torch.load(r"C:\Users\admin\Desktop\test1\w.pkl"))
print(model.fc1.weight)
print('/////////////////////////')
print(model.fc2.weight)
print('/////////////////////////////')
print(model.fc3.weight)

猜你喜欢

转载自blog.csdn.net/qq_39938666/article/details/85276707
今日推荐