-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Closed
Labels
bugSomething isn't workingSomething isn't workingstaleIssues that haven't received updatesIssues that haven't received updates
Description
Describe the bug
Hi! I am using accelerate + diffusers for fine-tuning of stable diffusion using this script:
https://github.com/huggingface/diffusers/blob/main/examples/text_to_image/train_text_to_image.py
I have pytorch 2.0 and accelerate recently supports torch dynamo for improving speed of training.
However, when I set dynamo_backend = "inductor" in Accelerator class, I am getting error
in validation stage:
line 67:
diffusers/examples/text_to_image/train_text_to_image.py
Lines 67 to 76 in 1a5797c
| pipeline = StableDiffusionPipeline.from_pretrained( | |
| args.pretrained_model_name_or_path, | |
| vae=accelerator.unwrap_model(vae), | |
| text_encoder=accelerator.unwrap_model(text_encoder), | |
| tokenizer=tokenizer, | |
| unet=accelerator.unwrap_model(unet), | |
| safety_checker=None, | |
| revision=args.revision, | |
| torch_dtype=weight_dtype, | |
| ) |
of type: <class 'torch._dynamo.eval_frame.OptimizedModule'>, but should be <class 'diffusers.models.modeling_utils.ModelMixin'>
The issue is for unet
Reproduction
| pipeline = StableDiffusionPipeline.from_pretrained( |
Logs
No response
System Info
pytorch==2.0.1
diffusers==0.17.0.dev0
accelerate==0.19.0
patrickvonplaten
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingstaleIssues that haven't received updatesIssues that haven't received updates