Skip to content

PytorchStreamReader failed reading zip archive:failed finding central directory #11

@MonsterMill

Description

@MonsterMill

Describe the bug

Hi,I'm following this video https://www.youtube.com/watch?v=Th-0oZjpDtk to deploy this diffuser on my AMD-GPU laptop,(python 3.10.8,Radeon 5600M),I started "save_onnx.py" and after it fetched 17 files,errors occurred(as reproduction)
Is this mean that I need to change the model? (now using waifu-diffusion from hugging face)
but, it also reports an UnicodeDecodeError mentioning that there exists an utf8 decode error.
thanks a lot for any replies.

Reproduction

Traceback (most recent call last):
File "F:\aihh\stable-diffusion-amd\diffusers-dml\src\diffusers\modeling_utils.py", line 71, in load_state_dict
return torch.load(checkpoint_file, map_location="cpu")
File "C:\Users\dell\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\serialization.py", line 705, in load
with _open_zipfile_reader(opened_file) as opened_zipfile:
File "C:\Users\dell\AppData\Local\Programs\Python\Python310\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

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "F:\aihh\stable-diffusion-amd\diffusers-dml\src\diffusers\modeling_utils.py", line 75, in load_state_dict
if f.read().startswith("version"):
UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 64: illegal multibyte sequence

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "F:\aihh\stable-diffusion-amd\diffusers-dml\examples\inference\save_onnx.py", line 16, in
pipe = StableDiffusionPipeline.from_pretrained("hakurei/waifu-diffusion", scheduler=lms, use_auth_token=True)
File "F:\aihh\stable-diffusion-amd\diffusers-dml\src\diffusers\pipeline_utils.py", line 248, in from_pretrained
loaded_sub_model = load_method(os.path.join(cached_folder, name), **loading_kwargs)
File "F:\aihh\stable-diffusion-amd\diffusers-dml\src\diffusers\modeling_utils.py", line 417, in from_pretrained
state_dict = load_state_dict(model_file)
File "F:\aihh\stable-diffusion-amd\diffusers-dml\src\diffusers\modeling_utils.py", line 87, in load_state_dict
raise OSError(
OSError: Unable to load weights from pytorch checkpoint file for 'C:\Users\dell/.cache\huggingface\diffusers\models--hakurei--waifu-diffusion\snapshots\cc452ee4c493761a0c5d6e92394729dbdcd2cb28\unet\diffusion_pytorch_model.bin' at 'C:\Users\dell/.cache\huggingface\diffusers\models--hakurei--waifu-diffusion\snapshots\cc452ee4c493761a0c5d6e92394729dbdcd2cb28\unet\diffusion_pytorch_model.bin'. If you tried to load a PyTorch model from a TF 2.0 checkpoint, please set from_tf=True.

Logs

No response

System Info

latest diffuser, python 3.10.8, AMD Radeon 5600M Graphics Card, Windows 11

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions