devilismyfriend / StableTuner

Finetuning SD in style.
GNU Affero General Public License v3.0
666 stars 51 forks source link

xformers not working via install script #127

Open raziel2001au opened 1 year ago

raziel2001au commented 1 year ago

Using the install script on Windows, it looks like there is a version mismatch with the dependencies it sets up in the environment, when I start up the software straight after using the install script, I get the following warning, and from what I can tell, many features aren't working, likely related to xformers:

Environment name is set as "ST" as per environment.yaml
anaconda3/miniconda3 detected in C:\Users\Francois\anaconda3
Starting conda environment "ST" from C:\Users\Francois\anaconda3
WARNING[XFORMERS]: xFormers can't load C++/CUDA extensions. xFormers was built for:
    PyTorch 1.13.1+cu117 with CUDA 1107 (you have 2.0.0+cu117)
    Python  3.10.10 (you have 3.10.0)
  Please reinstall xformers (see https://github.com/facebookresearch/xformers#installing-xformers)
  Memory-efficient attention, SwiGLU, sparse and more won't be available.
  Set XFORMERS_MORE_DETAILS=1 for more details

The warning can be fixed by uninstalling xformers, and then installing the latest version with:

pip uninstall xformers
pip install xformers

I'm not 100% sure how to check, but I think it's working after doing this... Can we please get the dependencies corrected so others don't run into this issue...

rafstahelin commented 1 year ago

Ran into this as well. Do I just run this pip in StableTuner.cmd?

raziel2001au commented 1 year ago

I have Anaconda installed, from memory, when you set up StableTuner, it creates an environment called ST, I activated that environment, then ran the pip commands. After that it worked and did some training as well.

rafstahelin commented 1 year ago

no i am still getting the xformers error

rafstahelin commented 1 year ago

Ok, small workaround, I copied pip uninstall xformers pip install xformers into the StableTuner.cmd file, at the very end before ::set HasChanges=0 Ran the cmd, it uninstalled and reinstalled the correct version. Then remvoed the pip lines, since no longer needed. Worked for, thanks to Raziel

moon47usaco commented 1 year ago

Thank you @rafstahelin

That was easier than activating the env by hand... =]

raziel2001au commented 1 year ago

Thank you @rafstahelin

That was easier than activating the env by hand... =]

I'm surprised this is still an issue. Sorry for pinging you directly @devilismyfriend, but is it possible to ask you to look into this? Everyone seems to be running into this issue and I suspect many who haven't fixed it manually probably don't even realise they are running without xformers...

alenknight commented 1 year ago

this didn't seem to fix for me.... i'm now getting this error

Environment name is set as "ST" as per environment.yaml
anaconda3/miniconda3 detected in C:\ProgramData\anaconda3
Starting conda environment "ST" from C:\ProgramData\anaconda3
WARNING[XFORMERS]: xFormers can't load C++/CUDA extensions. xFormers was built for:
    PyTorch 2.0.1+cu118 with CUDA 1108 (you have 2.0.1+cpu)
    Python  3.10.11 (you have 3.10.0)
  Please reinstall xformers (see https://github.com/facebookresearch/xformers#installing-xformers)
  Memory-efficient attention, SwiGLU, sparse and more won't be available.
  Set XFORMERS_MORE_DETAILS=1 for more details
warning: redirecting to https://github.com/devilismyfriend/StableTuner.git/
Latest git hash: 4c63853