Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

按照 README 微调太乙的 stable-diffusion 模型后,利用from_pretrained() 方法加载模型出错. #454

Open
hermanWu55 opened this issue Mar 12, 2024 · 0 comments

Comments

@hermanWu55
Copy link

https://github.com/IDEA-CCNL/Fengshenbang-LM/tree/main/fengshen/examples/finetune_taiyi_stable_diffusion 这百年按照了这个逻辑来运行了 finetune.sh 的脚本,没有修改逻辑,还是使用了 fengshen/examples/finetune_taiyi_stable_diffusion/demo_dataset/part_0 文件中提供的 数据拿来训练,我训练后,
在 workspace 中保存的模型,利用
pipe = StableDiffusionPipeline.from_pretrained(local_path).to("cuda")
这个脚本来执行,结果提示我如下报错:
You should probably TRAIN this model on a down-stream task to be able to use it for predictions and inference.
Loading pipeline components...: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████| 7/7 [00:56<00:00, 8.01s/it]
Traceback (most recent call last):
File "", line 1, in
File "/home/herman.wu/miniconda3/envs/sd39/lib/python3.9/site-packages/diffusers/pipelines/pipeline_utils.py", line 884, in to
module.to(device, dtype)
File "/home/herman.wu/miniconda3/envs/sd39/lib/python3.9/site-packages/transformers/modeling_utils.py", line 2556, in to
return super().to(*args, **kwargs)
File "/home/herman.wu/miniconda3/envs/sd39/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1152, in to
return self._apply(convert)
File "/home/herman.wu/miniconda3/envs/sd39/lib/python3.9/site-packages/torch/nn/modules/module.py", line 802, in _apply
module._apply(fn)
File "/home/herman.wu/miniconda3/envs/sd39/lib/python3.9/site-packages/torch/nn/modules/module.py", line 802, in _apply
module._apply(fn)
File "/home/herman.wu/miniconda3/envs/sd39/lib/python3.9/site-packages/torch/nn/modules/module.py", line 825, in _apply
param_applied = fn(param)
File "/home/herman.wu/miniconda3/envs/sd39/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1150, in convert
return t.to(device, dtype if t.is_floating_point() or t.is_complex() else None, non_blocking)
NotImplementedError: Cannot copy out of meta tensor; no data!

可以看一下是什么原因导致的么?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant