日本免费高清视频-国产福利视频导航-黄色在线播放国产-天天操天天操天天操天天操|www.shdianci.com

學無先后,達者為師

網站首頁 編程語言 正文

【debug】PytorchStreamReader failed reading zip archive: failed finding central directory

作者:cxxx17 更新時間: 2022-04-12 編程語言

libtorch(版本1.7)讀取pytorch(版本1.4)中存的tensor時,報錯PytorchStreamReader failed reading zip archive: failed finding central directory
save的代碼:

torch.save(cur_tensor, "cur_tensor.pt")

嘗試了網上的方法:

torch.save(cur_tensor, "cur_tensor.pt", _use_new_zipfile_serialization=False)
# or torch.save(cur_tensor, "cur_tensor.pt", _use_new_zipfile_serialization=True)

還是會報錯。
嘗試將pytorch版本也換成1.7,并且用

torch.save(cur_tensor, "cur_tensor.pt", _use_new_zipfile_serialization=True)

保存,libtorch可以正常讀取了

原文鏈接:https://blog.csdn.net/weixin_42262721/article/details/121403687

欄目分類
最近更新