safetensors_rust.SafetensorError: Error while deserializing header: MetadataIncompleteBuffer

使用stable diffusionv1-5 pipeline的时候报错如下safetensors_rust.SafetensorError: Error while deserializing header: MetadataIncompleteBuffer,具体日志为:

Traceback (most recent call last):
  File "/root/Faster-Diffusion-main/sd_demo.py", line 8, in <module>
    pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
  File "/root/miniconda3/envs/fastersd/lib/python3.9/site-packages/diffusers/pipelines/pipeline_utils.py", line 1253, in from_pretrained
    loaded_sub_model = load_sub_model(
  File "/root/miniconda3/envs/fastersd/lib/python3.9/site-packages/diffusers/pipelines/pipeline_utils.py", line 506, in load_sub_model
    loaded_sub_model = load_method(os.path.join(cached_folder, name), **loading_kwargs)
  File "/root/miniconda3/envs/fastersd/lib/python3.9/site-packages/transformers/modeling_utils.py", line 2604, in from_pretrained
    state_dict = load_state_dict(resolved_archive_file)
  File "/root/miniconda3/envs/fastersd/lib/python3.9/site-packages/transformers/modeling_utils.py", line 450, in load_state_dict
    with safe_open(checkpoint_file, framework="pt") as f:
safetensors_rust.SafetensorError: Error while deserializing header: MetadataIncompleteBuffer

模型文件不完整,解决办法:

https://huggingface.co/runwayml/stable-diffusion-v1-5/blob/main/v1-5-pruned-emaonly.safetensors

下载这个文件,然后替换掉,等待上传成功后再执行就可以解决了。

更多解决办法见[Bug]: Stable diffusion model loading error: SafetensorError · Issue #10199 · AUTOMATIC1111/stable-diffusion-webui · GitHub

评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值