CodeFormer icon indicating copy to clipboard operation
CodeFormer copied to clipboard

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

Open jingyuLin1999 opened this issue 2 years ago • 4 comments

when i use "python inference_colorization.py --input_path D:\CodeFormer\myinput", i meet this issue, how to solve this ?

[NOTE] The input face images should be aligned and cropped to a resolution of 512x512.
Traceback (most recent call last):
  File "D:\software\CodeFormer\inference_colorization.py", line 51, in <module>
    checkpoint = torch.load(ckpt_path)['params_ema']
  File "D:\software\python3.10.11\lib\site-packages\torch\serialization.py", line 993, in load
    with _open_zipfile_reader(opened_file) as opened_zipfile:
  File "D:\software\python3.10.11\lib\site-packages\torch\serialization.py", line 447, in __init__
    super().__init__(torch._C.PyTorchFileReader(name_or_buffer))
RuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory

python version 3.10.11 pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118

jingyuLin1999 avatar Jan 24 '24 14:01 jingyuLin1999

I'm also experiencing this issue, and it is due to incomplete model files downloaded with the script. My solution was to download the release model files from OneDrive. Then overwrite the original folder.

luooyii avatar Apr 07 '24 02:04 luooyii

Unfortunately, it still doesn't work

jingyuLin1999 avatar Apr 07 '24 11:04 jingyuLin1999

I'm also experiencing this issue, and it is due to incomplete model files downloaded with the script. My codeformer.pth only downloaded 2%. I don't know how to re-download it and don't know if this solution will work.

if you resolve your issue, please give me some references. 3Q

Eddie-cjz avatar Jun 26 '24 11:06 Eddie-cjz

我使用脚本下载的文件就是报上面的错误,我根据download脚本,使用浏览器重新下载,没有错误,我使用python=3.10.9,torch=2.0.1 @Eddie-cjz @jingyuLin1999 @luooyii

chenkai89 avatar Feb 13 '25 07:02 chenkai89