RuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory

问题:

在运行项目时,出现RuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory的问题

Traceback (most recent call last):
  File "F:\Project\GFPGAN-master\GFPGAN-master\inference_gfpgan.py", line 174, in <module>
    main()
  File "F:\Project\GFPGAN-master\GFPGAN-master\inference_gfpgan.py", line 70, in main
    bg_upsampler = RealESRGANer(
  File "D:\anaconda3\envs\SR\lib\site-packages\realesrgan\utils.py", line 63, in __init__
    loadnet = torch.load(model_path, map_location=torch.device('cpu'))
  File "D:\anaconda3\envs\SR\lib\site-packages\torch\serialization.py", line 705, in load
    with _open_zipfile_reader(opened_file) as opened_zipfile:
  File "D:\anaconda3\envs\SR\lib\site-packages\torch\serialization.py", line 242, in __init__
    super(_open_zipfile_reader, self).__init__(torch._C.PyTorchFileReader(name_or_buffer))
RuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory

原因:

模型下载因为网络问题没有下载成功,再次加载模型代码的时候报错。删除掉的模型,还存在缓存中,加载时加载了缓存中未下载成功的模型

解决办法:

去浏览器中重新下载模型,将模型路径换为本地路径

完美解决!!!!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

SQingL

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值