pytorch加载.pth文件

1.创建一个新的python文件
2.键入代码,运行。
注意:
profile后面为所要查看的pth文件地址。
代码:
import torch
pthfile = r’D:\deep reinforcemnt learning\PRUNING FILTERS FOR EFFICIENT CONVNETS\Pruning_filters_for_efficient_convnets-master\trained_models\check_point.pth’
net = torch.load(pthfile)
print(net)

Logo

有“AI”的1024 = 2048,欢迎大家加入2048 AI社区

更多推荐