网络模型的保存

  • 保存方式1 : 保存模型结构+模型参数 torch.save(“modle_name.pth”)
  • 保存方式2 : 只保存模型参数 torch.save(“modle_name.pth”, state_dict())