1. 程式人生 > >讀pkl檔案,並打印出每行的權重

讀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)