Pytorch模型保存和加载

保存模型:

torch.save(model, 'model.pth')

加载模型:

model = torch.load('model.pth')

 

posted @ 2022-02-03 11:45  Geeksongs  阅读(33)  评论(0编辑  收藏  举报

Coded by Geeksongs on Linux

All rights reserved, no one is allowed to pirate or use the document for other purposes.