【debug】安装diffusion的bug解决合集

编程入门 行业动态 更新时间:2024-10-18 12:34:27

【debug】安装diffusion的bug解决<a href=https://www.elefans.com/category/jswz/34/1769982.html style=合集"/>

【debug】安装diffusion的bug解决合集

环境问题

ImportError: cannot import name ‘CLIPImageProcessor’ from
‘transformers’ (D:\Python\lib\site-packages\transformers_init_.py)

解决:查看更详细信息,安装环境

transformers-cli env

网络问题

1 连接切换回本地,下载

model_id = "runwayml/stable-diffusion-v1-5"
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
pipe = pipe.to("cuda")

换成

model_id = "本地仓"
model_id = "D:\code\Github_code\Stable_diffusion\stable-diffusion-v1-5"pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16, revision="fp16")
pipe = pipe.to(device)

2

You seem to have cloned a repository without having git-lfs installed

从别的电脑上复制过来,而不是从hugging face直接下载。需要使用

git lfs pull

大文件下载中断问题

仅克隆小文件,大文件用下载工具下载,然后软连接。

 GIT_LFS_SKIP_SMUDGE=1 git clone 

不要用https,选ssh。

git lfs install
GIT_LFS_SKIP_SMUDGE=1  git clone git@hf.co:runwayml/stable-diffusion-v1-5

4

pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
Loading pipeline components...:  29%|██████████████████████████████████▌                                                                                      | 2/7 [00:00<00:00, 12.42it/s]
Traceback (most recent call last):File "C:\conda\envs\ldm\lib\site-packages\diffusers\models\modeling_utils.py", line 108, in load_state_dictreturn safetensors.torch.load_file(checkpoint_file, device="cpu")File "C:\conda\envs\ldm\lib\site-packages\safetensors\torch.py", line 308, in load_filewith safe_open(filename, framework="pt", device=device) as f:
safetensors_rust.SafetensorError: Error while deserializing header: HeaderTooLargeDuring handling of the above exception, another exception occurred:Traceback (most recent call last):File "<stdin>", line 1, in <module>File "C:\conda\envs\ldm\lib\site-packages\diffusers\pipelines\pipeline_utils.py", line 1105, in from_pretrainedloaded_sub_model = load_sub_model(File "C:\conda\envs\ldm\lib\site-packages\diffusers\pipelines\pipeline_utils.py", line 472, in load_sub_modelloaded_sub_model = load_method(os.path.join(cached_folder, name), **loading_kwargs)File "C:\conda\envs\ldm\lib\site-packages\diffusers\models\modeling_utils.py", line 641, in from_pretrainedstate_dict = load_state_dict(model_file, variant=variant)File "C:\conda\envs\ldm\lib\site-packages\diffusers\models\modeling_utils.py", line 113, in load_state_dictraise OSError(
OSError: You seem to have cloned a repository without having git-lfs installed. Please install git-lfs and run `git lfs install` followed by `git lfs pull` in the folder you cloned.

更多推荐

【debug】安装diffusion的bug解决合集

本文发布于:2023-12-06 19:14:09,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1668529.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:合集   debug   diffusion   bug

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!