Pytorchstreamreader failed reading zip archive: failed finding central directory

  • overview
  • issues

Error while using CPU for segmentation- "NET ERROR: PytorchStreamReader failed reading zip archive: failed finding central directory"

Show
    closed

    When I try segmentation using CPU, I am getting the error- "NET ERROR: PytorchStreamReader failed reading zip archive: failed finding central directory" I can't check if it works using GPU because my graphics card compute capacity seems to be incompatible with pytorch

    Windows 10 OS, and NVIDIA GEforce GT730

    can you try deleting your models folder and redownloading them? there may have been an interruption during download (see this issue: https://github.com/pytorch/pytorch/issues/31620)?

    the models folder is in your home directory /.cellpose/models, in windows e.g. C:/Users/carsen/.cellpose or linux e.g. /home/carsen/.cellpose

    going to close issue for now please comment if it's still not working

    Hey everyone... I've been really looking forward to trying out DiscoDiffusion for quite some time now. I finally sat down to give it a go but I'm getting some error messages and am not sure how to fix it. Any one have an idea what these errors refer to and how I can remedy them?

    RuntimeError Traceback (most recent call last) <ipython-input-15-c43607be9a63> in <module>() 160 print('Prepping model...') 161 model, diffusion = create_model_and_diffusion(**model_config) --> 162 model.load_state_dict(torch.load(f'{model_path}/{diffusion_model}.pt', map_location='cpu')) 163 model.requires_grad_(False).eval().to(device) 164 for name, param in model.named_parameters(): 1 frames/usr/local/lib/python3.7/dist-packages/torch/serialization.py in __init__(self, name_or_buffer) 240 class _open_zipfile_reader(_opener): 241 def __init__(self, name_or_buffer) -> None: --> 242 super(_open_zipfile_reader, self).__init__(torch._C.PyTorchFileReader(name_or_buffer)) 243 244 RuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory

    Question:

    I’m trying to run Disco Diffusion v5 with basically default settings and getting this error when I try to create the image. Does anyone know how to fix this?

    Starting Run: Horse 02(0) at frame 0
    
    Prepping model...
    
    RuntimeError                              Traceback (most recent call last)
    <ipython-input-20-da8a92ac51ae> in <module>()
        148 print('Prepping model...')
        149 model, diffusion = create_model_and_diffusion(**model_config)
    --> 150 model.load_state_dict(torch.load(f'{model_path}/{diffusion_model}.pt', map_location='cpu'))
        151 model.requires_grad_(False).eval().to(device)
        152 for name, param in model.named_parameters():
    
    1 frames
    /usr/local/lib/python3.7/dist-packages/torch/serialization.py in __init__(self, name_or_buffer)
        240 class _open_zipfile_reader(_opener):
        241     def __init__(self, name_or_buffer) -> None:
    --> 242         super(_open_zipfile_reader, self).__init__(torch._C.PyTorchFileReader(name_or_buffer))
        243 
        244 
    
    RuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory
    

    Answer:

    My way to solve this problem is to delete folder ‘AI’ in google Drive and run it all again. I guess the problem may be caused by an incomplete pre-traning model that was not downloaded correctly by the first run, which prevents the correct version of the model from being downloaded.

    If you have better answer, please add a comment about this, thank you!

    Pytoch reports an error:

    PytorchStreamReader failed reading zip archive: failed finding central directory

    Error reporting position

    An error is reported if the pre training model is not downloaded

    resnet101 = torchvision.models.resnet101(pretrained=True)
    

    Solution:

    Delete the file C:\Users\Username/.cache\torch\hub\checkpoints.pth

    Read More: