huggingface / huggingface/diffusers
single_file_utils.py#load_single_file_model_checkpoint bugs
- Ngôn ngữ chính
- Python
- Star
- 34.5k
- Fork
- 7.3k
- Merge trung bình
- 3 ngày 3 giờ
- Pull request đã merge (30 ngày)
- 91
Mô tả
### 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
Hướng dẫn đóng góp
Hướng nghiên cứu
Mở src/diffusers/loaders/single_file_utils.py và kiểm tra load_single_file_model_checkpoint, đặc biệt là các nhánh cảnh báo cho các checkpoint VAE, UNet và ControlNet. Tái hiện lỗi bằng cách tải một checkpoint một tệp có các khóa bổ sung, sau đó xác minh rằng mỗi cảnh báo xác định lớp mô hình mà không gây crash.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- python, pytorch
- Lĩnh vực
- machine-learning
- Loại issue
- Lỗi
- Độ khó
- 1/5
- Thời gian dự kiến
- Dưới một giờ
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức phù hợp với người mới
- 35/100