huggingface / huggingface/diffusers

single_file_utils.py#load_single_file_model_checkpoint bugs

オープン
#7,889 コメント 5 件 リアクション 0 件 担当者 0 名 GitHub で見る
bug stale
主要言語
Python
スター
34.5k
フォーク
7.3k
平均マージ
3日 3時間
マージ済み PR(30日)
91

説明

### Describe the bug

Loading a checkpoint from file crashes as it tries to print a warning with unexpected keys because is accessing `__name__` on incorrect target (instance instead of class)

https://github.com/huggingface/diffusers/blob/d50baf0c632342b9576a24352244c4235ce8b875/src/diffusers/loaders/single_file_utils.py

`f"Some weights of the model checkpoint were not used when initializing {vae.__name__}`
`f"Some weights of the model checkpoint were not used when initializing {unet.__name__}`
`f"Some weights of the model checkpoint were not used when initializing {controlnet.__name__}`

should be:

`[...].__class__.__name__`

### Reproduction

load a single file checkpoint with extra keys

### Logs

_No response_

### System Info

- `diffusers` version: 0.27.2
- Platform: Linux-6.8.8-1-clear-x86_64-with-glibc2.39
- Python version: 3.11.0
- PyTorch version (GPU?): 2.2.0+cu121 (True)
- Huggingface_hub version: 0.23.0
- Transformers version: 4.40.1
- Accelerate version: 0.30.0

### Who can help?

@sayakpaul

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

Open src/diffusers/loaders/single_file_utils.py and inspect load_single_file_model_checkpoint, especially the warning paths for VAE, UNet, and ControlNet checkpoints. Reproduce the failure by loading a single-file checkpoint with extra keys, then verify that each warning identifies the model class without crashing.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python, pytorch
領域
machine-learning
issue の種類
バグ
難易度
1/5
見積もり時間
1時間未満
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。