我有一个使用 Pytorch 创建的带有权重的.pth文件。我如何才能查看该文件中的权重?
我尝试加载和查看此代码,但它不起作用(作为新手,我可能完全错了)-
import torch
import torchvision.models as models
torch.save('weights\kharif_crops_final.pth')
models.load_state_dict(torch.load('weights\kharif_crops_final.pth'))
models.eval()
print(models)
Run Code Online (Sandbox Code Playgroud)