huggingface / huggingface/diffusers

Finetuned models aren't saved or loaded properly in train_custom_diffusion.py

Open
#9,320 8 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
34.5k
Forks
7.3k
Avg merge
3d 3h
Merged PRs (30d)
91

Description

### Describe the bug

Thank you for your amazing work. It seems like models are not saved or loaded properly after finetuning train_custom_diffusion.py in a new dataset. Generated validation images are expected but final test (inference) results are not expected as finetuned models are not used properly. The bug most probably in the following lines.

![image](https://github.com/user-attachments/assets/2419cb7a-be87-4211-bc38-f829fe60ffb2)

### Reproduction

Please finetune using a custom dataset and see the final test/inference results.

### Logs

_No response_

### System Info

- 珞 Diffusers version: 0.31.0.dev0
- Platform: Linux-6.5.0-45-generic-x86_64-with-glibc2.17
- Running on Google Colab?: No
- Python version: 3.8.19
- PyTorch version (GPU?): 2.4.0+cu121 (True)
- Flax version (CPU?/GPU?/TPU?): not installed (NA)
- Jax version: not installed
- JaxLib version: not installed
- Huggingface_hub version: 0.24.6
- Transformers version: 4.44.0
- Accelerate version: 0.33.0
- PEFT version: not installed
- Bitsandbytes version: not installed
- Safetensors version: 0.4.4
- xFormers version: not installed
- Accelerator: NVIDIA RTX A6000, 49140 MiB
NVIDIA RTX A6000, 49140 MiB
NVIDIA RTX A6000, 49140 MiB
NVIDIA RTX A6000, 49140 MiB
- Using GPU in script?: 4 NVIDIA RTX A6000 GPUs
- Using distributed or parallel set-up in script?: distributed

### Who can help?

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.