UNet2DConditionModel object has no attribute attn_processors. Did you mean: set_attn_processor

Posted on November 13, 2023 at 10:18 PM


When training lora model using train_text_to_image_lora.py, it reports errors like

UNet2DConditionModel object has no attribute attn_processors. Did you mean: set_attn_processor

After investigate reported error line in diffusers/loaders.py, and compare it with diffusers (version used) source code. Finally it is found that it is caused by diffusers package version. Uninstall the diffusers and re-install a lower version, problem fixed.

Most errors found in stable diffusion usage, which is caused by version mismatch. If you find diffusers or transformers related errors, first step is to check package version.