【pytorch】模型的保存、读取、查看模型参数

目录

  • 1 保存模型
    • 1.1 保存整个网络
    • 1.2 保存网络参数
      • 把参数以 `np.array` 的形式进行保存和读取
      • 跨设备的保存和加载
        • 在 GPU上保存,CPU上加载
        • GPU上保存,GPU上加载
        • CPU上保存,GPU上加载
        • 保存torch.nn.DataParallel模型
    • 1.3 保存优化器等
  • 2 读取模型
    • 2.1 读取整个网络
    • 2.2 读取网络参数到网络中
  • 3 参数查看
    • 3.1 net.named_parameters()
    • 3.2 net.parameters()
    • 3.3 net.state_di

你可能感兴趣的:(pytorch入门到精通,pytorch,python,深度学习)