pytorch保存模型非常简单: torch.save(model.state_dict(), ‘model.pth’) 加载已经保存的模型: model.load_state_dict(torch.load(‘model.pth’))