huggingface / huggingface/diffusers

Getting problems saving text_encoder_ti when using train_dreambooth_lora_sd15_advanced

未关闭
#8,909 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
bug stale
主要语言
Python
星标
34.5k
派生
7.3k
平均合并
3 天 3 小时
30 天内合并 PR
91

描述

### Describe the bug

Hi,

I encountered an issue while training Stable Diffusion 1.5 using the script `examples/advanced_diffusion_training/train_dreambooth_lora_sd15_advanced.py`.

The problem occurs when trying to save the text_encoder while also using textual inversion.

The following line of code seems to be causing the issue:

```python
embedding_handler.save_embeddings(f"{output_dir}/{args.output_dir}_emb.safetensors")
```

I discovered that removing {args.output_dir} from the path resolves the problem:

```
embedding_handler.save_embeddings(f"{output_dir}/ti_emb.safetensors")
```

Are there any alternative solutions to this issue? Any insights would be appreciated.

image

image

### Reproduction

Use the script train_dreambooth_lora_sd15_advanced.py
Enable textual inversion
Attempt to save the text_encoder

### Logs

_No response_

### System Info

- 🤗 Diffusers version: 0.30.0.dev0
- Platform: Linux-5.15.0-106-generic-x86_64-with-glibc2.35
- Running on a notebook?: No
- Running on Google Colab?: No
- Python version: 3.10.12
- PyTorch version (GPU?): 2.3.1+cu121 (True)
- Flax version (CPU?/GPU?/TPU?): not installed (NA)
- Jax version: not installed
- JaxLib version: not installed
- Huggingface_hub version: 0.23.4
- Transformers version: 4.42.3
- Accelerate version: 0.31.0
- PEFT version: 0.11.1
- Bitsandbytes version: not installed
- Safetensors version: 0.4.3
- xFormers version: 0.0.27
- Accelerator: NVIDIA A40, 46068 MiB
NVIDIA A40, 46068 MiB
NVIDIA A40, 46068 MiB
NVIDIA A40, 46068 MiB VRAM
- Using GPU in script?:
- Using distributed or parallel set-up in script?:

### Who can help?

_No response_

贡献指南

打开贡献指南

调研方向

从 examples/advanced_diffusion_training/train_dreambooth_lora_sd15_advanced.py 开始,在启用 textual inversion 和启用 text_encoder 保存的情况下重现运行。检查 issue 中显示的 embedding_handler.save_embeddings 路径,并验证 text_encoder 和 textual inversion embeddings 是否成功保存到预期的输出目录。

由索引模型根据 Issue 内容生成。

评估

技术栈
python, pytorch
领域
machine-learning
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。