读取Resnet50的网络结构
import torch
import torchvision
# 读取pth文件,查看模型结构
net = torchvision.models.resnet50(num_classes=600)
# 读取权重文件地址
pthfile = r'./Tongji_2022_04_15_19-49-14.pth'
net.load_state_dict(torch.load(pthfile),strict
读取Resnet50的网络结构
import torch
import torchvision
# 读取pth文件,查看模型结构
net = torchvision.models.resnet50(num_classes=600)
# 读取权重文件地址
pthfile = r'./Tongji_2022_04_15_19-49-14.pth'
net.load_state_dict(torch.load(pthfile),strict