天天看点

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

继续阅读