ModuleNotFoundError: import of xformers halted; None in sys.modules #6594
Replies: 4 comments 6 replies
-
You can find xformers official binaries here (ubuntu) or you can build it from source using:
|
Beta Was this translation helpful? Give feedback.
-
I have already attempted to build from source, resulting in the error above. On another note, I noticed the torch version installed is 1.12.1+cu113, but my system is running CUDA 11.7. Could this be related? |
Beta Was this translation helpful? Give feedback.
-
just add command line args: --xformers cat modules/import_hook.pyimport sys this will break any attempt to import xformers which will prevent stability diffusion repo from trying to use itif "--xformers" not in "".join(sys.argv): Why not leave a log here? |
Beta Was this translation helpful? Give feedback.
-
if "--xformers" not in "".join(sys.argv): |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am currently attempting to run the webui on a Debian 11 system, which works fine except for the error regarding
No module 'xformers'. Proceeding without it
. I have attempted multiple installations of xformers from here and here but to no avail.I have identified that error message being thrown is in the
repositories/stable-diffusion-stability-ai/ldm/modules/diffusionmodules/model.py
inside the try/except block. Xformers/xformers.ops is able to be imported when inside the python interpreter but doesn't work in the script. I moved the import statements out of the try/except block and it returned this:Traceback (most recent call last):
File "/home/stable-diffusion-webui/launch.py", line 307, in <module>
start()
File "/home/stable-diffusion-webui/launch.py", line 298, in start
import webui
File "/home/stable-diffusion-webui/webui.py", line 13, in <module>
from modules.call_queue import wrap_queued_call, queue_lock, wrap_gradio_gpu_call
File "/home/stable-diffusion-webui/modules/call_queue.py", line 7, in <module>
from modules import shared
File "/home/stable-diffusion-webui/modules/shared.py", line 17, in <module>
from modules import localization, sd_vae, extensions, script_loading, errors
File "/home/stable-diffusion-webui/modules/sd_vae.py", line 6, in <module>
from modules import shared, devices, script_callbacks, sd_models
File "/home/stable-diffusion-webui/modules/sd_models.py", line 18, in <module>
from modules.sd_hijack_inpainting import do_inpainting_hijack, should_hijack_inpainting
File "/home/stable-diffusion-webui/modules/sd_hijack_inpainting.py", line 7, in <module>
import ldm.models.diffusion.ddpm
File "/home/stable-diffusion-webui/repositories/stable-diffusion-stability-ai/ldm/models/diffusion/ddpm.py", line 26, in <module>
from ldm.models.autoencoder import IdentityFirstStage, AutoencoderKL
File "/home/stable-diffusion-webui/repositories/stable-diffusion-stability-ai/ldm/models/autoencoder.py", line 6, in <module>
from ldm.modules.diffusionmodules.model import Encoder, Decoder
File "/home/stable-diffusion-webui/repositories/stable-diffusion-stability-ai/ldm/modules/diffusionmodules/model.py", line 11, in <module>
import xformers
ModuleNotFoundError: import of xformers halted; None in sys.modules
Any help would be appreciated.
Currently running on python 3.10.7
Beta Was this translation helpful? Give feedback.
All reactions