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

[Bug]: ModuleNotFoundError: No module named 'torchsde'

Open kekekekekeshi opened this issue 2 years ago • 7 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues and checked the recent builds/commits

What happened?

../Documents/stable-diffusion-webui/repositories/k-diffusion/k_diffusion/sampling.py", line 7, in import torchsde ModuleNotFoundError: No module named 'torchsde'

请问一下这歌模块找不到应该安装点啥?

Steps to reproduce the problem

cd stable-diffusion-webui && ./run_webui_mac.sh

执行这个语句后就出现了

What should have happened?

至少不应该出现模块找不到吧,因为我已经执行了这个./setup_mac.sh,而且也安装了一堆whl

Commit where the problem happens

没有切换过分支,应该是master

What platforms do you use to access UI ?

MacOS

What browsers do you use to access the UI ?

Google Chrome

Command Line Arguments

No response

Additional information, context and logs

No response

kekekekekeshi avatar Nov 16 '22 13:11 kekekekekeshi

Apparently torchsde isnt included on the requirements.txt Try running pip install torchsde on your system terminal If you get "pip not found" run python3 -m pip instlal torchsde instead Once installed try again

chavinlo avatar Nov 16 '22 15:11 chavinlo

嗯。谢谢。我已经用上了呢 

小白 @.***

 

------------------ 原始邮件 ------------------ 发件人: "Carlos @.>; 发送时间: 2022年11月16日(星期三) 晚上11:14 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [AUTOMATIC1111/stable-diffusion-webui] [Bug]: ModuleNotFoundError: No module named 'torchsde' (Issue #4768)

显然torchsde不包含在 requirements.txt 中尝试 在pip install torchsde您的系统终端上运行 如果您得到“找不到 pip”,请运行 安装后重试python3 -m pip instlal torchsde

— 直接回复此邮件,在 GitHub 上查看,或取消订阅。 您收到此消息是因为您创作了该线程。消息 ID:<AUTOMATIC1111/stable-diffusion-webui/issues/4768/1317179340 @ github 。com>

kekekekekeshi avatar Nov 16 '22 15:11 kekekekekeshi

I have git pull right above call webui.bat in "webui-user.bat" just as is commonly recommended, so when I started up A1111 last night, it ran an attempt to pull, but I saw no updates. I did some work in the UI, and cranked up an embedding training session as I went to bed. Everything completed fine.

This morning, just to flush everything out, I closed the command window and restarted SD. In the process, a bunch of files updated, but afterwards,

Git for Windows 2.38.1.windows.1 (64-bit)
Up to date
Already up to date.
venv "G:\GitHub\SDWebUI\venv\Scripts\Python.exe"
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Commit hash: 64c7b7975cedeb2aaa1a9c8eb4a479fc575843f8
Installing requirements for Web UI
Dreambooth revision is c589a3596ade64228de8a7851f50c2470c7a76aa
Args: ['extensions\\sd_dreambooth_extension\\install.py']
[*] Diffusers version is 0.7.2.
[*] Torch version is 1.12.1+cu116.
[*] Torch vision version is 0.13.1+cu116.
[*] Transformers version is 4.21.0.
[*] Xformers

Launching Web UI with arguments: --xformers --vae models/Stable-diffusion/vae-ft-mse-840000-ema-pruned.ckpt --deepdanbooru --api --gradio-img2img-tool color-sketch
Traceback (most recent call last):
  File "G:\GitHub\SDWebUI\launch.py", line 255, in <module> start()
  File "G:\GitHub\SDWebUI\launch.py", line 246, in start import webui
  File "G:\GitHub\SDWebUI\webui.py", line 13, in <module> from modules import shared, devices, sd_samplers, upscaler, extensions, localization
  File "G:\GitHub\SDWebUI\modules\sd_samplers.py", line 8, in <module> import k_diffusion.sampling
  File "G:\GitHub\SDWebUI\repositories\k-diffusion\k_diffusion\__init__.py", line 1, in <module> from . import augmentation, config, evaluation, external, gns, layers, models, sampling, utils File "G:\GitHub\SDWebUI\repositories\k-diffusion\k_diffusion\external.py", line 6, in <module> from . import sampling, utils
  File "G:\GitHub\SDWebUI\repositories\k-diffusion\k_diffusion\sampling.py", line 7, in <module> import torchsde
ModuleNotFoundError: No module named 'torchsde'
Press any key to continue . . .

I have attempted the following:

  • pip install torchsde
  • python3 -m pip instlal torchsde (fixing "instlal" to "install", but this gives me an error as it's trying to run the version from the WindowsApps folder)
  • Completely uninstalled anything with "python" and reinstalled 3.10.6 specifically
  • Tried both of the pip installs above again
  • EDIT: added set PYTHON=C:\Users\Anthony\AppData\Local\Programs\Python\Python310\python.exe to webui-user.bat
  • EDIT2:
    • nuked python again
    • disabled python.exe and python3.exe in "App execution aliases in windows
    • reinstalled python 3.10.6 under administrator for all users
    • changed path in webui-user.bat to set PYTHON="C:\Program Files\Python310\python.exe"
    • deleted venv again
    • restarted SD
    • no dice

Not sure where to go from here, and was hoping to get some work done in SD today.

DoughyInTheMiddle avatar Nov 26 '22 15:11 DoughyInTheMiddle

I have git pull right above call webui.bat in "webui-user.bat" just as is commonly recommended, so when I started up A1111 last night, it ran an attempt to pull, but I saw no updates. I did some work in the UI, and cranked up an embedding training session as I went to bed. Everything completed fine.

This morning, just to flush everything out, I closed the command window and restarted SD. In the process, a bunch of files updated, but afterwards,

Git for Windows 2.38.1.windows.1 (64-bit)
Up to date
Already up to date.
venv "G:\GitHub\SDWebUI\venv\Scripts\Python.exe"
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Commit hash: 64c7b7975cedeb2aaa1a9c8eb4a479fc575843f8
Installing requirements for Web UI
Dreambooth revision is c589a3596ade64228de8a7851f50c2470c7a76aa
Args: ['extensions\\sd_dreambooth_extension\\install.py']
[*] Diffusers version is 0.7.2.
[*] Torch version is 1.12.1+cu116.
[*] Torch vision version is 0.13.1+cu116.
[*] Transformers version is 4.21.0.
[*] Xformers

Launching Web UI with arguments: --xformers --vae models/Stable-diffusion/vae-ft-mse-840000-ema-pruned.ckpt --deepdanbooru --api --gradio-img2img-tool color-sketch
Traceback (most recent call last):
  File "G:\GitHub\SDWebUI\launch.py", line 255, in <module> start()
  File "G:\GitHub\SDWebUI\launch.py", line 246, in start import webui
  File "G:\GitHub\SDWebUI\webui.py", line 13, in <module> from modules import shared, devices, sd_samplers, upscaler, extensions, localization
  File "G:\GitHub\SDWebUI\modules\sd_samplers.py", line 8, in <module> import k_diffusion.sampling
  File "G:\GitHub\SDWebUI\repositories\k-diffusion\k_diffusion\__init__.py", line 1, in <module> from . import augmentation, config, evaluation, external, gns, layers, models, sampling, utils File "G:\GitHub\SDWebUI\repositories\k-diffusion\k_diffusion\external.py", line 6, in <module> from . import sampling, utils
  File "G:\GitHub\SDWebUI\repositories\k-diffusion\k_diffusion\sampling.py", line 7, in <module> import torchsde
ModuleNotFoundError: No module named 'torchsde'
Press any key to continue . . .

I have attempted the following:

  • pip install torchsde
  • python3 -m pip instlal torchsde (fixing "instlal" to "install", but this gives me an error as it's trying to run the version from the WindowsApps folder)
  • Completely uninstalled anything with "python" and reinstalled 3.10.6 specifically
  • Tried both of the pip installs above again

Not sure where to go from here, and was hoping to get some work done in SD today.

Same thing is happening to me with today's update. I've also tried to manual install torchsde but i still get the same error.

ObiOneStenobi avatar Nov 26 '22 16:11 ObiOneStenobi

I'm not a python programmer. Never a skill I picked up. As such, I don't know how blasphemous this is, but after all the above attempts, I just copied the following directories from the Python installation directory into the SD/venv directory...and it worked.

torchsde torchsde-0.2.5.dist-info trampoline trampoline-0.1.2.dist-info boltons boltons-21.0.0.dist-info

When I first copied the "torchsde" folder over, it said it couldn't find "trampoline". After I copied those two over, it couldn't find "boltons". Afterwards....we're back up and running.

Launching Web UI with arguments: --xformers --vae models/Stable-diffusion/vae-ft-mse-840000-ema-pruned.ckpt --deepdanbooru --api --gradio-img2img-tool color-sketch
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
Loading weights [a9263745] from G:\GitHub\SDWebUI\models\Stable-diffusion\v1-5-pruned.ckpt
Global Step: 840000
Loading VAE weights from: models/Stable-diffusion/vae-ft-mse-840000-ema-pruned.ckpt
Applying xformers cross attention optimization.
Model loaded.
Loaded a total of 0 textual inversion embeddings.
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.

So: how incorrect is this process, and what can be done to make sure it doesn't happen again?

DoughyInTheMiddle avatar Nov 26 '22 17:11 DoughyInTheMiddle

@DoughyInTheMiddle an easier way would have been to: Open Console in root directory where you have stable-diffusion-webui then run "./venv/script/activate" to get into the virtual python environement and then run "pip install torchsde" or whatever else you are missing.

WildDogOne avatar Nov 29 '22 15:11 WildDogOne

I think I figured out the issue here. You need to install all the requirements under the VENV. It might be because the Dreambooth extension points to the Dreambooth requirements.txt instead.

I created a custom batch file that just copied/pasted the :activate_venv line from webui.bat and then did "pip install -r requirements.txt" and that solved it.

marinohardin avatar Dec 13 '22 00:12 marinohardin