原创 『PyTorch』模型的保存與加載

序列化與反序列化 序列化 torch.save(obj, f) 主要參數: obj:對象 f:輸出路徑 例如 保存整個模型 torch.save(net, path) 保存模型參數 state_dict=net.s