原文:解決torch.save時遇到的UserWarning

在用PyTorch保存模型時,常常會遇到UserWarning: Couldn t retrieve source code for container of type Net. It won t be checked for correctness upon loading. type obj. name . It won t be checked ,可參考這篇知乎文章解決這類警告。 ...

2020-08-12 13:08 0 1220 推薦指數:

查看詳情

torch.save torch.load 加載和保存模型

https://pytorch123.com/ThirdSection/SaveModel/ 這個鏈接非常的詳細! 1、#保存整個網絡 torch.save(net, PATH) # 保存網絡中的參數, 速度快,占空間少 torch.save(net.state_dict(),PATH) #------------------------------------------------- ...

Wed Mar 09 01:57:00 CST 2022 0 1231
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM