-
-
Notifications
You must be signed in to change notification settings - Fork 283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: 'text_encoder_lora_state_dict' from 'diffusers.loaders' #1397
Comments
It is still does not work. Installed versions xformers==0.0.21 and diffusers==0.23.1 lead to the same error: cannot import name 'text_encoder_lora_state_dict' from 'diffusers.loaders' |
I've tried on ubuntu, windows and mac, still no result |
pip list |
############################################################### Initializing Dreambooth no such option: --force-install Checking Dreambooth requirements... ####################################################################################################### LIBRARY ISSUE DETECTED####################################################################################################### bitsandbytes not installed.Dreambooth may not work properly.TROUBLESHOOTING1. Fully restart your project (not just the webpage)2. Update your A1111 project and extensions3. Dreambooth requirements should have installed automatically, but you can manually install themby running the following commands from the A1111 project root:cd venv/Scripts |
also i'm running ubuntu-22.04 but it recommends to install pip install --prefer-binary --force-reinstall https://github.com/jllllll/bitsandbytes-windows-webui/releases/download/wheels/bitsandbytes-0.41.1-py3-none-win_amd64.whl Windows binary |
I am also receiving this error. I tried the temporary fix as well that was posted in the original post but it did not fix my issue. I received the same error. I checked the versions being used and it lists the version posted as the temporary fix. Console LogInitializing dreambooth training...
Traceback (most recent call last):
File "E:\stable-diffusion-webui\extensions\sd_dreambooth_extension\dreambooth\ui_functions.py", line 732, in start_training
from dreambooth.train_dreambooth import main # noqa
File "E:\stable-diffusion-webui\extensions\sd_dreambooth_extension\dreambooth\train_dreambooth.py", line 32, in <module>
from diffusers.loaders import LoraLoaderMixin, text_encoder_lora_state_dict
ImportError: cannot import name 'text_encoder_lora_state_dict' from 'diffusers.loaders' (E:\stable-diffusion-webui\venv\lib\site-packages\diffusers\loaders\__init__.py)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "E:\stable-diffusion-webui\extensions\sd_dreambooth_extension\dreambooth\ui_functions.py", line 734, in start_training
from dreambooth.train_dreambooth import main # noqa
File "E:\stable-diffusion-webui\extensions\sd_dreambooth_extension\dreambooth\train_dreambooth.py", line 32, in <module>
from diffusers.loaders import LoraLoaderMixin, text_encoder_lora_state_dict
ImportError: cannot import name 'text_encoder_lora_state_dict' from 'diffusers.loaders' (E:\stable-diffusion-webui\venv\lib\site-packages\diffusers\loaders\__init__.py) |
It seems that you don't have the argument to use xformers set. I am not saying it will fix your issues but it should at least get you past the No module You can see how to do it at Command Line Arguments and Settings |
Thanks, will try it right now |
I got this error ,too , running this extension in the stable diffusion on Windows11 `Checking Dreambooth requirements... [Dreambooth] pytorch_optimizer v2.12.0 is already installed. To create a public link, set During handling of the above exception, another exception occurred: Traceback (most recent call last): |
my method to solve this:
I have verify this on fresh install and existing The best thing is wait digitalhigh release new update |
Thanks a lot ,but it's still did not work .maybe waiting is the best thing ,as you say |
I get a similiar error. Initializing dreambooth During handling of the above exception, another exception occurred: Traceback (most recent call last): |
Initializing Dreambooth [Dreambooth] pytorch_optimizer v2.12.0 is already installed. |
if Instead of make sure |
Hi I'm using this extension on Automatic 111 that is running on a container, so I can't change the version of the diffuser by hand. Can you fix the version to 0.23.1? |
I am not sure how it is on other OS's but on Windows, if you are trying to use the fix from the OP post, make sure you are running the commands within the environment created by Automatic1111. To change the version of
This will install the specified version of Like @Anime4000 said, make sure you see, This worked for me. |
I no longer get the error having switched back to diffusers version 0.23.1. It doesn't appear to be doing any training either, however, even with the same settings as a previous version of sd_dreambooth that works great. |
I'm on Mac (Intel) and have installed diffusers 0.23.1, but get the same error. |
Can you please post the startup process from the terminal when you run Automatic1111? |
Yes, of course :) `################################################################ Initializing Dreambooth no such option: --force-install Checking Dreambooth requirements... ####################################################################################################### LIBRARY ISSUE DETECTED####################################################################################################### torch is below the required 2.0.1+cu118 version.torchvision is below the required 0.15.2+cu118 version.bitsandbytes not installed.Dreambooth may not work properly.TROUBLESHOOTING1. Fully restart your project (not just the webpage)2. Update your A1111 project and extensions3. Dreambooth requirements should have installed automatically, but you can manually install themby running the following commands from the A1111 project root:cd venv/Scripts |
Thanks. If you look at your console log, you can see that after the "Checking Dreambooth requirements..." line, you have a few more Dreambooth lines. After that last one you see this: [!] xformers NOT installed.
[!] torch version 2.0.1 installed.
[!] torchvision version 0.15.2 installed.
[+] accelerate version 0.21.0 installed.
[+] diffusers version 0.24.0 installed.
[+] transformers version 4.30.2 installed.
[!] bitsandbytes NOT installed. You can see that the environment that Automatic1111 is using is still using diffusers 0.24.0. I made a comment a few comments up about this. If Automatic1111 runs on a Mac the same as Windows, which I would believe it does, it creates a virtual environment when you run the startup script. So you have to change the version of diffusers in that environment. |
Thanks a lot , it works for me !!!! Windows11 |
There was something wrong with my venv folder. I deleted it and installed all requirements new in the venv. But now I get a new diffuser error: Initializing bucket counter! |
I am using this extension on windows 11, and I recieved the same problem. Downgrading the module 'diffusers' from '0.24.0' to '0.23.1' seemed to work for me. |
@Anime4000 I also encountered this problem, showing "ImportError: cannot import name 'text_encoder_lora_state_dict' from 'diffusers.loaders'". I found this function in the official library of diffuser and found that it will be replaced in version 0.27.0, maybe This problem can be solved by temporarily copying the function into the file where it is introduced. |
Yep, that's exactly what they did in the official SDXL training script. Should now be fixed in main. |
i move the function from loaders.__init__py to models.__init__py,and then it ran fine |
This should already be fixed in main.
…On Wed, Dec 13, 2023, 11:01 PM husw725 ***@***.***> wrote:
i move the function from loaders.__init__py to models.__init__py,and then
it ran fine
—
Reply to this email directly, view it on GitHub
<#1397 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMO4NCR7D7NKZGCKEP6AALYJKBY7AVCNFSM6AAAAABAAXAC3SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJVGEZTEMRZGM>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
Is there an existing issue for this?
What happened?
during fresh install,
pip
using latestdiffusers 0.24
as perrequirements.txt
:[+] diffusers version 0.24.0 installed.
Steps to reproduce the problem
pip install diffusers>=0.23.1
(it will install 0.24.0)if don't, do
diffusers==0.24.0
Commit and libraries
Starting at
Initializing Dreambooth
and ending several lines below at[+] bitsandbytes version 0.35.4 installed.
.Command Line Arguments
Console logs
Additional information
to fix this temporary run this from
venv
:For upcoming changes of
diffusers >= 0.24.0
, perhaps not to usetext_encoder_lora_state_dict
on normal UNETThe text was updated successfully, but these errors were encountered: