.pt/pth 文件读取

import torch

path='/media/workstation/4.0T/master/model.pth'

pretrained_dict = torch.load(path)

for k, v in pretrained_dict.items():  # k 参数名 v 对应参数值
    
    print(k)

你可能感兴趣的:(python)