kohya-ss / sd-scripts

Apache License 2.0
5.19k stars 862 forks source link

Cannot find module _C.pyd #415

Open Helyan47 opened 1 year ago

Helyan47 commented 1 year ago

Hi, when I'm using the Dreamboth LoRA, the command line shows the next error:

enable LoRA for U-Net prepare optimizer, data loader etc. use AdamW optimizer | {} running training / 学習開始 num train images * repeats / 学習画像の数×繰り返し回数: 2000 num reg images / 正則化画像の数: 0 num batches per epoch / 1epochのバッチ数: 1000 num epochs / epoch数: 1 batch size per device / バッチサイズ: 2 gradient accumulation steps / 勾配を合計するステップ数 = 1 total optimization steps / 学習ステップ数: 1000 steps: 0%| | 0/1000 [00:00<?, ?it/s]epoch 1/1 Could not find module 'E:\IA\Plugins\Kohya\kohya_ss\venv\Lib\site-packages\xformers_C.pyd' (or one of its dependencies). Try using the full path with constructor syntax. WARNING:root:WARNING: Could not find module 'E:\IA\Plugins\Kohya\kohya_ss\venv\Lib\site-packages\xformers_C.pyd' (or one of its dependencies). Try using the full path with constructor syntax. Need to compile C++ extensions to get sparse attention suport. Please run python setup.py build develop

The file exists in the specified location. Anyone has any idea what the problem is?

Before this error I had other related with libbitsandbytes_cuda116.dll. I solved it like it specifies in this issue: https://github.com/TimDettmers/bitsandbytes/issues/161 Thanks you

LiuQing119 commented 1 year ago

I have the same question. Did you have ever solved it yet?

kohya-ss commented 1 year ago

The installation of xformers seems to be something wrong. Please uninstall with pip uninstall xformers and try to install again with pip install -U -I --no-deps https://github.com/C43H66N12O12S2/stable-diffusion-webui/releases/download/f/xformers-0.0.14.dev0-cp310-cp310-win_amd64.whl.

xathian commented 1 year ago

Having this same issue, your solution above did not fix it

Hantiun commented 2 months ago

I had the same problem and fixed it by deleting the python_embeded folder then extracting a new python_embeded folder from the comfyui prortable install to the old location and it worked again