天天看點

RuntimeError: [enforce fail at inline_container.cc:145] . PytorchStreamReader failed reading zip arcRuntimeError: [enforce fail at inline_container.cc:145] . PytorchStreamReader failed reading zip archive: failed finding central directory

RuntimeError: [enforce fail at inline_container.cc:145] . PytorchStreamReader failed reading zip archive: failed finding central directory

這個報錯是出現在PyTorch在讀入模型參數時:

筆者之前在訓練模型,突然伺服器整個停掉,發現竟然是系統固态硬碟沒有空間了,無法繼續操作,故删了一些不用的檔案,繼續開始訓練,然後重新載入之前存在儲存的模型就會報錯如上。

既然是在訓練過程中用盡了硬碟空間,那就應該是停在某個大規模讀寫硬碟的過程中,那就肯定是在儲存模型的過程中了。即在某一輪訓練完成後,儲存模型參數時,占盡了硬碟空間,導緻程式停掉。即有可能某一輪在儲存模型參數時沒有儲存完就停止了,而在重新讀取模型參數時讀到的也是沒有儲存完整的模型參數,是以報錯,想了一下隻能是這個問題了。

這也與筆者在網上查到的一些資料吻合。

Ref:

https://blog.csdn.net/weixin_44831720/article/details/113853623

繼續閱讀