Skip to content

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

Closed

Description

@dhlsam

(draggan) PS D:> python -m draggan.web
C:\Users\sam.conda\envs\draggan\lib\site-packages\torch\utils\cpp_extension.py:358: UserWarning: Error checking compiler version for cl: [WinError 2]
warnings.warn(f'Error checking compiler version for {compiler}: {error}')
C:\Users\sam.conda\envs\draggan\lib\site-packages\draggan\stylegan2\op\fused_act.py:23: UserWarning: (This is not error) Switch to native implementation
f"(This is not error) Switch to native implementation"
C:\Users\sam.conda\envs\draggan\lib\site-packages\draggan\stylegan2\op\upfirdn2d.py:22: UserWarning: (This is not error) Switch to native implementation
f"(This is not error) Switch to native implementation"
Traceback (most recent call last):
File "C:\Users\sam.conda\envs\draggan\lib\runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "C:\Users\sam.conda\envs\draggan\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\sam.conda\envs\draggan\lib\site-packages\draggan\web.py", line 346, in
demo = main()
File "C:\Users\sam.conda\envs\draggan\lib\site-packages\draggan\web.py", line 241, in main
wrapped_model = ModelWrapper(ckpt=DEFAULT_CKPT, size=CKPT_SIZE[DEFAULT_CKPT])
File "C:\Users\sam.conda\envs\draggan\lib\site-packages\draggan\web.py", line 78, in init
self.g_ema = stylegan2(**kwargs).to(device)
File "C:\Users\sam.conda\envs\draggan\lib\site-packages\draggan\api.py", line 126, in stylegan2
checkpoint = torch.load(get_path(ckpt))
File "C:\Users\sam.conda\envs\draggan\lib\site-packages\torch\serialization.py", line 777, in load
with _open_zipfile_reader(opened_file) as opened_zipfile:
File "C:\Users\sam.conda\envs\draggan\lib\site-packages\torch\serialization.py", line 282, in init
super(_open_zipfile_reader, self).init(torch._C.PyTorchFileReader(name_or_buffer))
RuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory

follow the PyPI install instructions,get runtime error

Activity

  1. Zeqiang-Lai commented on May 26, 2023

    @Zeqiang-Lai
    Collaborator

    Your checkpoints are broken.

    Use this command to obtain the directory where the checkpoints saved.

    python -c "import draggan; print(draggan.home)"  
    

    For example, here is my checkpoint.
    /home/laizeqiang/draggan/checkpoints

    Then, remove it and run the program again would download the checkpoints again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions