liasece / sd-webui-train-tools Goto Github PK
View Code? Open in Web Editor NEWThe stable diffusion webui training aid extension helps you quickly and visually train models such as Lora.
License: Other
The stable diffusion webui training aid extension helps you quickly and visually train models such as Lora.
License: Other
min_snr_gamma,weighted_captions
如题,使用lion可以正常,请问是什么原因啊
在跑模型的时候,遇到了这样的问题:
MemoryError: Out of memory interning an attribute name
然后会出现一系列系统提示显示有问题
我遇到问题如下:
import network module: networks.lora
Train Tools: train.train error No module named 'networks.lora'; 'networks' is not a package
Traceback (most recent call last):
File "/Users/mbp/stable-diffusion-webui/extensions/sd-webui-train-tools/liasece_sd_webui_train_tools/train_ui.py", line 127, in on_train_begin_click
train.train(cfg)
File "/Users/mbp/stable-diffusion-webui/extensions/sd-webui-train-tools/liasece_sd_webui_train_tools/train.py", line 37, in train
train_network.train(args)
File "/Users/mbp/stable-diffusion-webui/extensions/sd-webui-train-tools/liasece_sd_webui_train_tools/sd_scripts/train_network.py", line 153, in train
network_module = importlib.import_module(args.network_module)
File "/opt/homebrew/Cellar/[email protected]/3.10.12_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1001, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'networks.lora'; 'networks' is not a package
MacBook Pro Apple M2 Max
1,可否改成支持上传图片但不进行任何处理,因为最终还是需要手动打tag,经常是tag已经打好
2,如果可以把训练的所有参数列在一个文档里面,然后gradio创建一个textox进行展示,用户需要哪个就改哪个,如果哪里sd新增了参数用户也可以自己手动添加
3,可否让这个插件也可以独立webui单独运行,因为sd的diffusers版本和dreambooth版本会冲突
建议不一定成熟,可以随时关闭这个issues
When I try to install, the following error message appears.
Error loading script: train_tools.py
Traceback (most recent call last):
File "D:\Data\AI\stable-diffusion-webui\modules\scripts.py", line 256, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File "D:\Data\AI\stable-diffusion-webui\modules\script_loading.py", line 11, in load_module
module_spec.loader.exec_module(module)
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "D:\Data\AI\stable-diffusion-webui\extensions\sd-webui-train-tools\scripts\train_tools.py", line 7, in <module>
from liasece_sd_webui_train_tools.ui import *
File "D:\Data\AI\stable-diffusion-webui\extensions\sd-webui-train-tools\liasece_sd_webui_train_tools\ui.py", line 16, in <module>
from liasece_sd_webui_train_tools.train_ui import *
File "D:\Data\AI\stable-diffusion-webui\extensions\sd-webui-train-tools\liasece_sd_webui_train_tools\train_ui.py", line 10, in <module>
from liasece_sd_webui_train_tools import train
File "D:\Data\AI\stable-diffusion-webui\extensions\sd-webui-train-tools\liasece_sd_webui_train_tools\train.py", line 11, in <module>
from liasece_sd_webui_train_tools.Parser import Parser, ensure_path
Python version: 3.10.6
同时训练多个参数(如图1),生成preview图片时,程序报错:
Error completing request
Arguments: ('task(mzhjbhokm37k30w)', 'mountain', 'v4', 'anything-v3-bs-8-ep-20-op-Adam-lr-0_0001-net-128-ap-64', False, 'A picture of a single mountain, best quality,Amazing,finely detail,extremely detailed CG unity 8k wallpaper', 'low quality, out of frame', ['Euler a', 'DPM++ SDE', 'DPM++ 2M SDE'], '30', 512, 512, 1, 8, '10', '-1', '0.6,0.7,0.8,1') {}
Traceback (most recent call last):
File "/data/xuhaoran/stable-diffusion-webui/modules/call_queue.py", line 57, in f
res = list(func(*args, **kwargs))
File "/data/xuhaoran/stable-diffusion-webui/modules/call_queue.py", line 37, in f
res = func(*args, **kwargs)
File "/data/xuhaoran/stable-diffusion-webui/extensions/sd-webui-train-tools/liasece_sd_webui_train_tools/checkpoint_preview_ui.py", line 199, in on_ui_preview_generate_all_preview_btn_click
preview.preview_checkpoint(save_image_path, checkpoint_name, checkpoint_path,
File "/data/xuhaoran/stable-diffusion-webui/extensions/sd-webui-train-tools/liasece_sd_webui_train_tools/preview.py", line 96, in preview_checkpoint
args+=[find_index_in_current_axis_options("Sampler"), preview_sampling_method.join(",")]
AttributeError: 'list' object has no attribute 'join'
Traceback (most recent call last):
File "/data/xuhaoran/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/routes.py", line 414, in run_predict
output = await app.get_blocks().process_api(
File "/data/xuhaoran/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/blocks.py", line 1326, in process_api
data = self.postprocess_data(fn_index, result["prediction"], state)
File "/data/xuhaoran/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/blocks.py", line 1257, in postprocess_data
assert isinstance(
AssertionError: <class 'gradio.layouts.Box'> Component with id 2250 not a valid output component.
Can I get some help?Why hasn't it started after 30 minutes?The progress bar hasn't moved at all.
import network module: networks.lora
create LoRA network. base dim (rank): 128, alpha: 64.0
create LoRA for Text Encoder: 72 modules.
create LoRA for U-Net: 192 modules.
enable LoRA for text encoder
enable LoRA for U-Net
prepare optimizer, data loader etc.
use Adam | {'weight_decay': 0.1, 'betas': (0.9, 0.99)}
override steps. steps for 20 epochs is / 指定エポックまでのステップ数: 9600
running training / 学習開始
num train images * repeats / 学習画像の数×繰り返し回数: 960
num reg images / 正則化画像の数: 0
num batches per epoch / 1epochのバッチ数: 480
num epochs / epoch数: 20
batch size per device / バッチサイズ: 2
gradient accumulation steps / 勾配を合計するステップ数 = 1
total optimization steps / 学習ステップ数: 9600
steps: 0%| | 0/9600 [00:00<?, ?it/s]epoch 1/20
Train Tools: train.train error replace_unet_cross_attn_to_xformers.<locals>.forward_xformers() got an unexpected keyword argument 'encoder_hidden_states'
steps: 0%| | 0/9600 [00:01<?, ?it/s]
maybe the error is critical,but I can't solve it
Train Tools: train.train error replace_unet_cross_attn_to_xformers.<locals>.forward_xformers() got an unexpected keyword argument 'encoder_hidden_states'
I installed this but it is not showing up anywhere.
################################################################
Launching launch.py...
################################################################
Python 3.9.7 (default, Sep 16 2021, 13:09:58)
[GCC 7.5.0]
Commit hash: 22bcc7be428c94e9408f589966c2040187245d81
Installing requirements for Web UI
Installing sd-webui-train-tools requirement: /home/dawei/stable-diffusion-webui/extensions/sd-webui-train-tools/requirements.txt
#######################################################################################################
Initializing Civitai Link
If submitting an issue on github, please provide the below text for debugging purposes:
Python revision: 3.9.7 (default, Sep 16 2021, 13:09:58)
[GCC 7.5.0]
Civitai Link revision: c4d4b2e374eccb5f192929a1332e46852f494173
SD-WebUI revision: 22bcc7be428c94e9408f589966c2040187245d81
Checking Civitai Link requirements...
[+] python-socketio[client] version 5.7.2 installed.
Error loading script: train_tools.py
Traceback (most recent call last):
File "/home/test/stable-diffusion-webui/modules/scripts.py", line 256, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File "/home/test/stable-diffusion-webui/modules/script_loading.py", line 11, in load_module
module_spec.loader.exec_module(module)
File "", line 850, in exec_module
File "", line 228, in _call_with_frames_removed
File "/home/test/stable-diffusion-webui/extensions/sd-webui-train-tools/scripts/train_tools.py", line 7, in
from liasece_sd_webui_train_tools.ui import *
File "/home/test/stable-diffusion-webui/extensions/sd-webui-train-tools/liasece_sd_webui_train_tools/ui.py", line 8, in
from liasece_sd_webui_train_tools.util import *
File "/home/test/stable-diffusion-webui/extensions/sd-webui-train-tools/liasece_sd_webui_train_tools/util.py", line 12, in
def readImages(inputPath: str, level: int = 0, include_pre_level: bool = False, endswith :str | list[str] = [".png",".jpg",".jpeg",".bmp",".webp"], startswith: str | list[str] = None) -> list[Image.Image]:
TypeError: unsupported operand type(s) for |: 'type' and 'types.GenericAlias'
The following error statement appears and the task crashes when auto-crap is applied.
All works well if auto crop is disabled.
Train Tools: dataset update error OpenCV(4.8.1) D:\a\opencv-python\opencv-python\opencv\modules\dnn\src\net_impl.cpp:279: error: (-204:Requested object was not found) Layer with requested id=-1 not found in function 'cv::dnn::dnn4_v20230620::Net::Impl::getLayerData'
Traceback (most recent call last)
File "C:\stable-diffusion-webui\extensions\sd-webui-train-tools\liasece_sd_webui_train_tools\dateset_ui.py", line 107, in on_ui_update_dataset_click
preprocess.preprocess(None, origin_preload_data_path, processed_output_path,
File "C:\stable-diffusion-webui\extensions\sd-webui-train-tools\liasece_sd_webui_train_tools\tools\preprocess.py", line 22, in preprocess
preprocess_work(process_src, process_dst, process_width, process_height, preprocess_txt_action, process_keep_original_size, process_flip, process_split, process_caption, process_caption_deepbooru, split_threshold, overlap_ratio, process_focal_crop, process_focal_crop_face_weight, process_focal_crop_entropy_weight, process_focal_crop_edges_weight, process_focal_crop_debug, process_multicrop, process_multicrop_mindim, process_multicrop_maxdim, process_multicrop_minarea, process_multicrop_maxarea, process_multicrop_objective, process_multicrop_threshold)
File "C:\stable-diffusion-webui\extensions\sd-webui-train-tools\liasece_sd_webui_train_tools\tools\preprocess.py", line 216, in preprocess_work
for focal in autocrop.crop_image(img, autocrop_settings):
File "C:\stable-diffusion-webui\modules\textual_inversion\autocrop.py", line 33, in crop_image
focus = focal_point(im_debug, settings)
File "C:\stable-diffusion-webui\modules\textual_inversion\autocrop.py", line 76, in focal_point
face_points = image_face_points(im, settings) if settings.face_points_weight > 0 else []
File "C:\stable-diffusion-webui\modules\textual_inversion\autocrop.py", line 151, in image_face_points
faces = detector.detect(np.array(im))
cv2.error: OpenCV(4.8.1) D:\a\opencv-python\opencv-python\opencv\modules\dnn\src\net_impl.cpp:279: error: (-204:Requested object was not found) Layer with requested id=-1 not found in function 'cv::dnn::dnn4_v20230620::Net::Impl::getLayerData'
I found the following interesting statement regarding this issue.
AUTOMATIC1111/stable-diffusion-webui#11727
This is the same problem as the above page, and I wonder if this is due to the open cv version upgrade (4.7 series→4.8 series) that came with the control net update.
I have a log of open cv 4.8 in my PC that was upgraded on the day the problem occurred.
But i dont know how to downgrade.
I installed this extension and confirmed that the webui shows the Train Tools tab.
Next, I tried Create Project, but an error occurred and I couldn't create it.
Attached below are the environment, the created procedure, and the error.
Please check it, thank you.
$ cd ~/stable-diffusion-webui/extensions
$ git clone https://github.com/liasece/sd-webui-train-tools
$ cd sd-webui-train-tools
$ git submodule update --init
In addition, when installing by the method of Extensions - Install from URL of stable-diffusion-webui, the file of liasece_sd_webui_train_tools/sd_scripts
using git submodule became empty, so I did it by the above method.
$ python launch.py --xformers --api --listen
Python 3.10.10 (main, Mar 25 2023, 15:35:14) [GCC 8.3.0]
Commit hash: 91ae48fd7e20c60d6374f340cac0939f56d87048
I did the following on the UI.
but there was no response.
Train Tools: create project: ['miku', '', '']
Traceback (most recent call last):
File "/home/my_username/.pyenv/versions/3.10.10/lib/python3.10/site-packages/gradio/routes.py", line 394, in run_predict
output = await app.get_blocks().process_api(
File "/home/my_username/.pyenv/versions/3.10.10/lib/python3.10/site-packages/gradio/blocks.py", line 1075, in process_api
result = await self.call_function(
File "/home/my_username/.pyenv/versions/3.10.10/lib/python3.10/site-packages/gradio/blocks.py", line 884, in call_function
prediction = await anyio.to_thread.run_sync(
File "/home/my_username/.pyenv/versions/3.10.10/lib/python3.10/site-packages/anyio/to_thread.py", line 31, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File "/home/my_username/.pyenv/versions/3.10.10/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 937, in run_sync_in_worker_thread
return await future
File "/home/my_username/.pyenv/versions/3.10.10/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 867, in run
result = context.run(func, *args)
File "/home/my_username/stable-diffusion-webui/extensions/sd-webui-train-tools/liasece_sd_webui_train_tools/project_version_ui.py", line 68, in on_ui_create_project_click
os.makedirs(os.path.join(str(get_root_path()), new_project_name))
File "/home/my_username/.pyenv/versions/3.10.10/lib/python3.10/posixpath.py", line 90, in join
genericpath._check_arg_types('join', a, *p)
File "/home/my_username/.pyenv/versions/3.10.10/lib/python3.10/genericpath.py", line 152, in _check_arg_types
raise TypeError(f'{funcname}() argument must be str, bytes, or '
TypeError: join() argument must be str, bytes, or os.PathLike object, not 'list'
OS: ubuntu
stable diffusion webui: updated: 2023-05-14, hash: 89f9faa6
train tools: b8dc771
console:
To create a public link, set `share=True` in `launch()`.
Startup time: 23.4s (import torch: 2.8s, import gradio: 0.7s, import ldm: 0.8s, other imports: 0.8s, load scripts: 16.7s, create ui: 1.2s, gradio launch: 0.2s, scripts app_started_callback: 0.1s).
Train Tools: get_project_list: outputs/train_tools/projects/test
Train Tools: get_project_version_list: outputs/train_tools/projects/test/versions/v1
Train Tools: ui_refresh_project: ['test']
Error messages
stderr: ERROR: Invalid requirement: 'Files\\stable-diffusion-webui\\extensions\\sd-webui-train-tools\\requirements.txt' Hint: It looks like a path. File 'Files\stable-diffusion-webui\extensions\sd-webui-train-tools\requirements.txt' does not exist.
actual path is here in this case.
-> D:\Program Files\stable-diffusion-webui\extensions\sd-webui-train-tools\requirements.txt
I modified 15 line in the code as follows in local and managed to execute it successfully.
launch.run_pip(f'install -r "{python_requirements_file}"', f"sd-webui-train-tools requirement: {python_requirements_file}")
base model名字有空格时会报错,如 Realistic Vision V4.0_V4.0.safetensors。会报 UnboundLocalError: cannot access local variable 'train_name' where it is not associated with a value
你好,我有四张10G的gpu卡,但是我发现lora训练只能使用一张卡,无法多卡训练。请问该怎么解决多卡运行的问题呢?谢谢
I am Japanese. Sorry for my poor English. I'm using a translation software, so I'm sorry if I'm wrong.
I have read the other threads, but I couldn't figure out where to enter the commands and such.
I installed sd-webui-train-tools, but the torein tools tab does not appear.
The error message is as follows
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug 1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Error running install.py for extension D:\GenerativeAI\webui\extensions\sd-webui-train-tools.
Command: "D:\GenerativeAI\system\python\python.exe" "D:\GenerativeAI\webui\extensions\sd-webui-train-tools\install.py"
Error code: 1
stdout:
stderr: Traceback (most recent call last):
File "D:\GenerativeAI\webui\extensions\sd-webui-train-tools\install.py", line 8, in
repo.git.submodule("update", "--init", "--recursive", "--force")
File "D:\GenerativeAI\system\python\lib\site-packages\git\cmd.py", line 741, in
return lambda *args, **kwargs: self._call_process(name, *args, **kwargs)
File "D:\GenerativeAI\system\python\lib\site-packages\git\cmd.py", line 1315, in _call_process
return self.execute(call, **exec_kwargs)
File "D:\GenerativeAI\system\python\lib\site-packages\git\cmd.py", line 1109, in execute
raise GitCommandError(redacted_command, status, stderr_value, stdout_value)
git.exc.GitCommandError: Cmd('git') failed due to: exit code(1)
cmdline: git submodule update --init --recursive --force
stderr: 'git: 'submodule' is not a git command. See 'git --help'.'
Launching Web UI with arguments: --xformers
ControlNet v1.1.106
ControlNet v1.1.106
Error loading script: train_tools.py
Traceback (most recent call last):
File "D:\GenerativeAI\webui\modules\scripts.py", line 256, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File "D:\GenerativeAI\webui\modules\script_loading.py", line 11, in load_module
module_spec.loader.exec_module(module)
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "D:\GenerativeAI\webui\extensions\sd-webui-train-tools\scripts\train_tools.py", line 7, in
from liasece_sd_webui_train_tools.ui import *
File "D:\GenerativeAI\webui\extensions\sd-webui-train-tools\liasece_sd_webui_train_tools\ui.py", line 16, in
from liasece_sd_webui_train_tools.train_ui import *
File "D:\GenerativeAI\webui\extensions\sd-webui-train-tools\liasece_sd_webui_train_tools\train_ui.py", line 10, in
from liasece_sd_webui_train_tools import train
File "D:\GenerativeAI\webui\extensions\sd-webui-train-tools\liasece_sd_webui_train_tools\train.py", line 8, in
from liasece_sd_webui_train_tools.ArgsList import ArgStore
File "D:\GenerativeAI\webui\extensions\sd-webui-train-tools\liasece_sd_webui_train_tools\ArgsList.py", line 22, in
import liasece_sd_webui_train_tools.sd_scripts.train_network as train_network
ModuleNotFoundError: No module named 'liasece_sd_webui_train_tools.sd_scripts.train_network'
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug 1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Version: v1.6.0-2-g4afaaf8a
Commit hash: 4afaaf8a020c1df457bcf7250cb1c7f609699fa7
WARNING:xformers:A matching Triton is not available, some optimizations will not be enabled.
Error caught was: No module named 'triton'
E:\stable-diffusion-webui\system\python\lib\site-packages\pytorch_lightning\utilities\distributed.py:258: LightningDeprecationWarning: `pytorch_lightning.utilities.distributed.rank_zero_only` has been deprecated in v1.8.1 and will be removed in v2.0.0. You can import it from `pytorch_lightning.utilities` instead.
rank_zero_deprecation(
*** Error running install.py for extension E:\stable-diffusion-webui\webui\extensions\sd-webui-train-tools.
*** Command: "E:\stable-diffusion-webui\system\python\python.exe" "E:\stable-diffusion-webui\webui\extensions\sd-webui-train-tools\install.py"
*** Error code: 1
*** stderr: Traceback (most recent call last):
*** File "E:\stable-diffusion-webui\webui\extensions\sd-webui-train-tools\install.py", line 8, in <module>
*** repo.git.submodule("update", "--init", "--recursive", "--force")
*** File "E:\stable-diffusion-webui\system\python\lib\site-packages\git\cmd.py", line 741, in <lambda>
*** return lambda *args, **kwargs: self._call_process(name, *args, **kwargs)
*** File "E:\stable-diffusion-webui\system\python\lib\site-packages\git\cmd.py", line 1315, in _call_process
*** return self.execute(call, **exec_kwargs)
*** File "E:\stable-diffusion-webui\system\python\lib\site-packages\git\cmd.py", line 1109, in execute
*** raise GitCommandError(redacted_command, status, stderr_value, stdout_value)
*** git.exc.GitCommandError: Cmd('git') failed due to: exit code(1)
*** cmdline: git submodule update --init --recursive --force
*** stderr: 'git: 'submodule' is not a git command. See 'git --help'.'
Launching Web UI with arguments:
*** Error loading script: train_tools.py
Traceback (most recent call last):
File "E:\stable-diffusion-webui\webui\modules\scripts.py", line 382, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File "E:\stable-diffusion-webui\webui\modules\script_loading.py", line 10, in load_module
module_spec.loader.exec_module(module)
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "E:\stable-diffusion-webui\webui\extensions\sd-webui-train-tools\scripts\train_tools.py", line 7, in <module>
from liasece_sd_webui_train_tools.ui import *
File "E:\stable-diffusion-webui\webui\extensions\sd-webui-train-tools\liasece_sd_webui_train_tools\ui.py", line 16, in <module>
from liasece_sd_webui_train_tools.train_ui import *
File "E:\stable-diffusion-webui\webui\extensions\sd-webui-train-tools\liasece_sd_webui_train_tools\train_ui.py", line 10, in <module>
from liasece_sd_webui_train_tools import train
File "E:\stable-diffusion-webui\webui\extensions\sd-webui-train-tools\liasece_sd_webui_train_tools\train.py", line 8, in <module>
from liasece_sd_webui_train_tools.ArgsList import ArgStore
File "E:\stable-diffusion-webui\webui\extensions\sd-webui-train-tools\liasece_sd_webui_train_tools\ArgsList.py", line 22, in <module>
import liasece_sd_webui_train_tools.sd_scripts.train_network as train_network
ModuleNotFoundError: No module named 'liasece_sd_webui_train_tools.sd_scripts.train_network'
---
I found Train Tool will find the base model in the default directory(stable-diffusion-webui/models/Stable-diffusion). But I used another directory to store my models by the --ckpt-dir
webui parameter.
Train Tools: on_train_begin_click {'base_model': '/root/stable-diffusion-webui/models/Stable-diffusion/anything-v4.5-pruned-fp16.ckpt', 'img_folder': '/root/stable-diffusion-webui/outputs/train_tools/projects/test/versions/v1/dataset/processed', 'output_folder': '/root/stable-diffusion-webui/outputs/train_tools/projects/test/versions/v1/trains/anything-v4_5-pruned-fp16-bs-1-ep-20-op-Lion-lr-0_0001-net-128-ap-64', 'save_json_folder': None, 'save_json_name': None, 'load_json_path': None, 'multi_run_folder': None, 'reg_img_folder': None, 'sample_prompts': None, 'change_output_name': 'test-v1', 'json_load_skip_list': None, 'training_comment': None, 'save_json_only': False, 'tag_occurrence_txt_file': True, 'sort_tag_occurrence_alphabetically': False, 'optimizer_type': 'Lion', 'optimizer_args': {'weight_decay': '0.1', 'betas': '0.9,0.99'}, 'scheduler': 'cosine', 'cosine_restarts': 1, 'scheduler_power': 1, 'learning_rate': 0.0001, 'unet_lr': None, 'text_encoder_lr': None, 'warmup_lr_ratio': None, 'unet_only': False, 'net_dim': 128, 'alpha': 64, 'train_resolution': 512, 'height_resolution': None, 'batch_size': 1, 'clip_skip': 2, 'test_seed': 23, 'mixed_precision': 'fp16', 'save_precision': 'fp16', 'lyco': False, 'network_args': None, 'num_epochs': 20, 'save_every_n_epochs': 2, 'save_n_epoch_ratio': None, 'save_last_n_epochs': None, 'max_steps': None, 'sample_sampler': None, 'sample_every_n_steps': None, 'sample_every_n_epochs': None, 'buckets': True, 'min_bucket_resolution': 320, 'max_bucket_resolution': 960, 'bucket_reso_steps': None, 'bucket_no_upscale': False, 'shuffle_captions': False, 'keep_tokens': None, 'xformers': True, 'cache_latents': True, 'flip_aug': False, 'v2': False, 'v_parameterization': False, 'gradient_checkpointing': False, 'gradient_acc_steps': None, 'noise_offset': None, 'mem_eff_attn': False, 'lora_model_for_resume': None, 'save_state': False, 'resume': None, 'text_only': False, 'vae': None, 'log_dir': None, 'log_prefix': None, 'tokenizer_cache_dir': None, 'dataset_config': None, 'lowram': False, 'no_meta': False, 'color_aug': False, 'random_crop': False, 'use_8bit_adam': False, 'use_lion': False, 'caption_dropout_rate': None, 'caption_dropout_every_n_epochs': None, 'caption_tag_dropout_rate': None, 'prior_loss_weight': 1, 'max_grad_norm': 1, 'save_as': 'safetensors', 'caption_extension': '.txt', 'max_clip_token_length': 150, 'save_last_n_epochs_state': None, 'num_workers': 8, 'persistent_workers': True, 'face_crop_aug_range': None, 'network_module': 'networks.lora', 'locon_dim': None, 'locon_alpha': None, 'locon': False}
Failed to find base_model, Please make sure path is correct.
抱歉,我看错了,是我的问题
我的sd-webui部署在服务器,无法使用ui界面,可否使用api模式训练LoRA模型呢?
开始训练的时候报错
Train Tools: train.train error replace_unet_cross_attn_to_xformers.<locals>.forward_xformers() got an unexpected keyword argument 'encoder_hidden_states'
Traceback (most recent call last):
File "D:\ai\stable-diffusion-webui\extensions\sd-webui-train-tools\liasece_sd_webui_train_tools\train_ui.py", line 121, in on_train_begin_click
train.train(cfg)
File "D:\ai\stable-diffusion-webui\extensions\sd-webui-train-tools\liasece_sd_webui_train_tools\train.py", line 68, in train
train_network.train(args)
File "D:\ai\stable-diffusion-webui\extensions\sd-webui-train-tools\liasece_sd_webui_train_tools\sd_scripts\train_network.py", line 538, in train
noise_pred = unet(noisy_latents, timesteps, encoder_hidden_states).sample
File "D:\ai\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl
return forward_call(*input, **kwargs)
File "D:\ai\stable-diffusion-webui\venv\lib\site-packages\accelerate\utils\operations.py", line 495, in __call__
return convert_to_fp32(self.model_forward(*args, **kwargs))
File "D:\ai\stable-diffusion-webui\venv\lib\site-packages\torch\amp\autocast_mode.py", line 14, in decorate_autocast
return func(*args, **kwargs)
File "D:\ai\stable-diffusion-webui\venv\lib\site-packages\diffusers\models\unet_2d_condition.py", line 582, in forward sample, res_samples = downsample_block(
File "D:\ai\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl
return forward_call(*input, **kwargs)
File "D:\ai\stable-diffusion-webui\venv\lib\site-packages\diffusers\models\unet_2d_blocks.py", line 837, in forward
hidden_states = attn(
File "D:\ai\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl
return forward_call(*input, **kwargs)
File "D:\ai\stable-diffusion-webui\venv\lib\site-packages\diffusers\models\transformer_2d.py", line 265, in forward
hidden_states = block(
File "D:\ai\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl
return forward_call(*input, **kwargs)
File "D:\ai\stable-diffusion-webui\venv\lib\site-packages\diffusers\models\attention.py", line 291, in forward
attn_output = self.attn1(
File "D:\ai\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl
return forward_call(*input, **kwargs)
TypeError: replace_unet_cross_attn_to_xformers.<locals>.forward_xformers() got an unexpected keyword argument 'encoder_hidden_states'
python 3.10.6
Thanks for the easy to use extension.
However, it stopped working with SD web UI V1.1.0. I want to modify it, but I can't publish it because there is no license notation.
Could you please add the license?
训练完后自动测试模型报错。
save trained model to D:\sd-webui-aki-v4\outputs\train_tools\projects\yangmi\versions\v1\trains\chilloutmix_NiPrunedFp32Fix-bs-1-ep-6-op-Lion-lr-0_0001-net-64-ap-64\yangmi-v1.safetensors
model saved.
Train Tools: preview checkpoint: yangmi-v1(outputs\train_tools\projects\yangmi\versions\v1\trains\chilloutmix_NiPrunedFp32Fix-bs-1-ep-6-op-Lion-lr-0_0001-net-64-ap-64\yangmi-v1.safetensors) 1/3
Train Tools: txt2img: <lora:yangmi-v1:0.6>, best quality,Amazing,finely detail,extremely detailed CG unity 8k wallpaper [7, '<lora:yangmi-v1:0.6>,<lora:yangmi-v1:0.7>,<lora:yangmi-v1:0.8>,<lora:yangmi-v1:1>', 0, '', 0, '', True, False, False, False, 0]
Train Tools: Error while processing <lora:yangmi-v1:0.6>, best quality,Amazing,finely detail,extremely detailed CG unity 8k wallpaper Script.run() missing 3 required positional arguments: 'include_sub_grids', 'no_fixed_seeds', and 'margin_size'
Traceback (most recent call last):
File "D:\sd-webui-aki-v4\extensions\sd-webui-train-tools\liasece_sd_webui_train_tools\preview.py", line 117, in preview_checkpoint
processed = runner.run(p, *args)
TypeError: Script.run() missing 3 required positional arguments: 'include_sub_grids', 'no_fixed_seeds', and 'margin_size'
提示:Python 运行时抛出了一个异常。请检查疑难解答页面。
Train Tools: preview checkpoint: yangmi-v1-000004(outputs\train_tools\projects\yangmi\versions\v1\trains\chilloutmix_NiPrunedFp32Fix-bs-1-ep-6-op-Lion-lr-0_0001-net-64-ap-64\yangmi-v1-000004.safetensors) 2/3
Train Tools: txt2img: <lora:yangmi-v1-000004:0.6>, best quality,Amazing,finely detail,extremely detailed CG unity 8k wallpaper [7, '<lora:yangmi-v1-000004:0.6>,<lora:yangmi-v1-000004:0.7>,<lora:yangmi-v1-000004:0.8>,<lora:yangmi-v1-000004:1>', 0, '', 0, '', True, False, False, False, 0]
Train Tools: Error while processing <lora:yangmi-v1-000004:0.6>, best quality,Amazing,finely detail,extremely detailed CG unity 8k wallpaper Script.run() missing 3 required positional arguments: 'include_sub_grids', 'no_fixed_seeds', and 'margin_size'
Traceback (most recent call last):
File "D:\sd-webui-aki-v4\extensions\sd-webui-train-tools\liasece_sd_webui_train_tools\preview.py", line 117, in preview_checkpoint
processed = runner.run(p, *args)
Train Tools: preview checkpoint: yangmi-v1-000002(outputs\train_tools\projects\yangmi\versions\v1\trains\chilloutmix_NiPrunedFp32Fix-bs-1-ep-6-op-Lion-lr-0_0001-net-64-ap-64\yangmi-v1-000002.safetensors) 3/3
TypeError: Script.run() missing 3 required positional arguments: 'include_sub_grids', 'no_fixed_seeds', and 'margin_size'
提示:Python 运行时抛出了一个异常。请检查疑难解答页面。
Train Tools: txt2img: <lora:yangmi-v1-000002:0.6>, best quality,Amazing,finely detail,extremely detailed CG unity 8k wallpaper [7, '<lora:yangmi-v1-000002:0.6>,<lora:yangmi-v1-000002:0.7>,<lora:yangmi-v1-000002:0.8>,<lora:yangmi-v1-000002:1>', 0, '', 0, '', True, False, False, False, 0]
Train Tools: Error while processing <lora:yangmi-v1-000002:0.6>, best quality,Amazing,finely detail,extremely detailed CG unity 8k wallpaper Script.run() missing 3 required positional arguments: 'include_sub_grids', 'no_fixed_seeds', and 'margin_size'
Traceback (most recent call last):
File "D:\sd-webui-aki-v4\extensions\sd-webui-train-tools\liasece_sd_webui_train_tools\preview.py", line 117, in preview_checkpoint
processed = runner.run(p, *args)
TypeError: Script.run() missing 3 required positional arguments: 'include_sub_grids', 'no_fixed_seeds', and 'margin_size'
提示:Python 运行时抛出了一个异常。请检查疑难解答页面。
Train Tools: in get_checkpoint_preview_images: project: yangmi v1 chilloutmix_NiPrunedFp32Fix-bs-1-ep-6-op-Lion-lr-0_0001-net-64-ap-64 yangmi-v1: xyz_grid 0, sub_grid 0, all_img 0
Train Tools: in get_checkpoint_preview_images: project: yangmi v1 chilloutmix_NiPrunedFp32Fix-bs-1-ep-6-op-Lion-lr-0_0001-net-64-ap-64 yangmi-v1-000004: xyz_grid 0, sub_grid 0, all_img 0
Train Tools: in get_checkpoint_preview_images: project: yangmi v1 chilloutmix_NiPrunedFp32Fix-bs-1-ep-6-op-Lion-lr-0_0001-net-64-ap-64 yangmi-v1-000002: xyz_grid 0, sub_grid 0, all_img 0
我尝试使用anything-v4.0-pruned-fp32.ckpt 是可以训练的,但是我使用sdxl版本,或者sd1.5版本的都会报错,也就是模型参数不一致,是不是只支持部分sd模型
感谢作者提供了这么棒的扩展~
我测试了使用该工具(sd-webui-train-tools)训练60张素材和使用脚本(lora-scripts)训练60张相同素材
结果使用页面工具的训练结果完全不拟合,通过脚本训练的结果效果较好,麻烦帮忙看下问题可能出现在哪里?
使用脚本默认配置
$max_train_epoches = 10
$save_every_n_epochs = 1
$lr = "1e-4"
$network_dim = 32
$network_alpha = 32
$clip_skip = 2
$use_8bit_adam = 1
$use_lion = 0
设置扩展页面上的配置
Clip skip :2
Save every n epochs:1
Batch size:1
Number of epochs:10
Learning rate:0.0001
Net dim:32
Alpha:32
Optimizer type:
Mixed precision:fp16
从日志看存在的问题:
1.通过页面上传的60张素材,最后文件夹名字是8_xx,虽然素材都处理了,但是没有正确识别数量
2.训练的步数远小于预期(4800<36000)
另外 https://github.com/kohya-ss/sd-scripts 已在本仓库引用版本后更新了较多内容,请评估下是否可以更新到最新版本,Thanks~
您好,我在开始训练的时候遇到的如下情况:
loading image sizes.
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 20/20 [00:00<00:00, 23689.94it/s]
make buckets
number of images (including repeats) / 各bucketの画像枚数(繰り返し回数を含む)
bucket 0: resolution (512, 512), count: 1020
mean ar error (without repeats): 0.0
prepare accelerator
load StableDiffusion checkpoint
loading u-net:
loading vae:
loading text encoder:
Replace CrossAttention.forward to use xformers
Train Tools: train.train error No xformers / xformersがインストールされていないようです
Traceback (most recent call last):
File "/home/user/stable-diffusion-webui/extensions/sd-webui-train-tools/liasece_sd_webui_train_tools/sd_scripts/library/train_util.py", line 1672, in replace_unet_cross_attn_to_xformers
import xformers.ops
ModuleNotFoundError: No module named 'xformers.ops'; 'xformers' is not a package
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/user/stable-diffusion-webui/extensions/sd-webui-train-tools/liasece_sd_webui_train_tools/train_ui.py", line 121, in on_train_begin_click
train.train(cfg)
File "/home/user/stable-diffusion-webui/extensions/sd-webui-train-tools/liasece_sd_webui_train_tools/train.py", line 68, in train
train_network.train(args)
File "/home/user/stable-diffusion-webui/extensions/sd-webui-train-tools/liasece_sd_webui_train_tools/sd_scripts/train_network.py", line 134, in train
train_util.replace_unet_modules(unet, args.mem_eff_attn, args.xformers)
File "/home/user/stable-diffusion-webui/extensions/sd-webui-train-tools/liasece_sd_webui_train_tools/sd_scripts/library/train_util.py", line 1626, in replace_unet_modules
replace_unet_cross_attn_to_xformers()
File "/home/user/stable-diffusion-webui/extensions/sd-webui-train-tools/liasece_sd_webui_train_tools/sd_scripts/library/train_util.py", line 1674, in replace_unet_cross_attn_to_xformers
raise ImportError("No xformers / xformersがインストールされていないようです")
ImportError: No xformers / xformersがインストールされていないようです
请问这是什么问题,我第一次遇到这个问题找了一个解决方案是:Change '--force-enable-xformers' to '--xformers' guys.
但是我使用的python launch.py启动的程序,没有传入任何的参数。但是我也尝试修改了:启动后爆了memory的异常,去掉这'--xformers' 参数后又爆了core dumped。
我现在是重装了一个新的环境,重新运行的,第二次遇到了这个错误。
I always use it with docker. Thank you!
I used this train-tools to create Lora.
Then, it says that it saved the safetensors file in the following directory, but I can't find it by using find or grep commands.
outputs/train_tools/projects/likeface/versions/v1/trains/chilled_remix_v1vae-bs-1-ep-20-op-Lion-lr-0_0001-net-128-ap-64/likeface-v 1.safetensors
The data
and output
directories are there, but the outputs
directory was not found.
If you are running stable diffusion in docker, does anyone know where it is stored?
Enviroment: Colab
Error loading script: train_tools.py
Traceback (most recent call last):
File "/content/drive/MyDrive/stable-diffusion-webui-colab/stable-diffusion-webui/modules/scripts.py", line 248, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File "/content/drive/MyDrive/stable-diffusion-webui-colab/stable-diffusion-webui/modules/script_loading.py", line 11, in load_module
module_spec.loader.exec_module(module)
File "", line 850, in exec_module
File "", line 228, in _call_with_frames_removed
File "/content/drive/MyDrive/stable-diffusion-webui-colab/stable-diffusion-webui/extensions/sd-webui-train-tools/scripts/train_tools.py", line 7, in
from liasece_sd_webui_train_tools.ui import *
File "/content/drive/MyDrive/stable-diffusion-webui-colab/stable-diffusion-webui/extensions/sd-webui-train-tools/liasece_sd_webui_train_tools/ui.py", line 8, in
from liasece_sd_webui_train_tools.util import *
File "/content/drive/MyDrive/stable-diffusion-webui-colab/stable-diffusion-webui/extensions/sd-webui-train-tools/liasece_sd_webui_train_tools/util.py", line 12, in
def readImages(inputPath: str, level: int = 0, include_pre_level: bool = False, endswith :str | list[str] = [".png",".jpg",".jpeg",".bmp",".webp"]) -> list[Image.Image]:
TypeError: unsupported operand type(s) for |: 'type' and 'types.GenericAlias'
found directory /content/drive/MyDrive/stable-diffusion-webui-colab/stable-diffusion-webui/outputs/train_tools/projects/xx/versions/v2/dataset/processed/28_xx contains 20 image files
500 train images with repeating.
0 reg images.
no regularization images / 正則化画像が見つかりませんでした
Platform: macOS 13.5 on M2 Pro
Automatic1111 SD-WebUI: v1.5.4
Python: v3.10.12
torch: v1.12.1
The WebUI works well, but when installing this extension from URL it stucks showing "Loading" below the install button.
No output in terminal.
Then, stuck in "installing requirements for web ui" on restart.
If this extension is manually removed from the dir, the Web UI runs normally.
Hi 我在训练lora 的时候遇到问题:
谢谢 🙏
mac上训练的时候,返回
Train Tools: train.train error fp16 mixed precision requires a GPU
Traceback (most recent call last):
File "/Users/kingzeus/Development/ai/stable-diffusion-webui/extensions/sd-webui-train-tools/liasece_sd_webui_train_tools/train_ui.py", line 121, in on_train_begin_click
train.train(cfg)
File "/Users/kingzeus/Development/ai/stable-diffusion-webui/extensions/sd-webui-train-tools/liasece_sd_webui_train_tools/train.py", line 68, in train
train_network.train(args)
File "/Users/kingzeus/Development/ai/stable-diffusion-webui/extensions/sd-webui-train-tools/liasece_sd_webui_train_tools/sd_scripts/train_network.py", line 119, in train
accelerator, unwrap_model = train_util.prepare_accelerator(args)
File "/Users/kingzeus/Development/ai/stable-diffusion-webui/extensions/sd-webui-train-tools/liasece_sd_webui_train_tools/sd_scripts/library/train_util.py", line 2498, in prepare_accelerator
accelerator = Accelerator(
File "/opt/homebrew/lib/python3.10/site-packages/accelerate/accelerator.py", line 286, in __init__
raise ValueError(err.format(mode="fp16", requirement="a GPU"))
ValueError: fp16 mixed precision requires a GPU
kohya_ss 设置的时候可以支持mps/cpu 模式,能否增加下支持?
plz help me I can't use train tools.
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug 1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Commit hash: 22bcc7be428c94e9408f589966c2040187245d81
Installing requirements for Web UI
Error running install.py for extension C:\SD\sd.webui\webui\extensions\sd-webui-train-tools.
Command: "C:\SD\sd.webui\system\python\python.exe" "C:\SD\sd.webui\webui\extensions\sd-webui-train-tools\install.py"
Error code: 1
stdout:
stderr: Traceback (most recent call last):
File "C:\SD\sd.webui\webui\extensions\sd-webui-train-tools\install.py", line 8, in
repo.git.submodule("update", "--init", "--recursive", "--force")
File "C:\SD\sd.webui\system\python\lib\site-packages\git\cmd.py", line 741, in
return lambda *args, **kwargs: self._call_process(name, *args, **kwargs)
File "C:\SD\sd.webui\system\python\lib\site-packages\git\cmd.py", line 1315, in _call_process
return self.execute(call, **exec_kwargs)
File "C:\SD\sd.webui\system\python\lib\site-packages\git\cmd.py", line 1109, in execute
raise GitCommandError(redacted_command, status, stderr_value, stdout_value)
git.exc.GitCommandError: Cmd('git') failed due to: exit code(1)
cmdline: git submodule update --init --recursive --force
stderr: 'git: 'submodule' is not a git command. See 'git --help'.'
What shuld I do?
在3月29号的版本下,生成预览图报错
感觉是默认提供的正向提示词产生的路径非法,导致报错
best quality,Amazing,finely detail,extremely detailed CG unity 8k wallpaper
Total progress: 223it [04:14, 11.71it/s]Train Tools: Error while processing <lora:yangmi-v1:0.6>, best quality,Amazing,finely detail,extremely detailed CG unity 8k wallpaper [Errno 2] No such file or directory: 'outputs\\train_tools\\projects\\yangmi\\versions\\v1\\trains\\chilloutmix_NiPrunedFp32Fix-bs-1-ep-6-op-Lion-lr-0_0001-net-64-ap-64\\yangmi-v1\\images\\xyz_grid-0000-1944501389-_lora_yangmi-v1_0.6_, best quality,Amazing,finely detail,extremely detailed CG unity 8k wallpaper.tmp'
Traceback (most recent call last):
File "D:\sd-webui-aki-v4\extensions\sd-webui-train-tools\liasece_sd_webui_train_tools\preview.py", line 117, in preview_checkpoint
processed = runner.run(p, *args)
File "D:\sd-webui-aki-v4\scripts\xyz_grid.py", line 675, in run
images.save_image(processed.images[g], p.outpath_grids, "xyz_grid", info=processed.infotexts[g], extension=opts.grid_format, prompt=processed.all_prompts[adj_g], seed=processed.all_seeds[adj_g], grid=True, p=processed)
File "D:\sd-webui-aki-v4\modules\images.py", line 584, in save_image
_atomically_save_image(image, fullfn_without_extension, extension)
File "D:\sd-webui-aki-v4\modules\images.py", line 554, in _atomically_save_image
image_to_save.save(temp_file_path, format=image_format, quality=opts.jpeg_quality, pnginfo=pnginfo_data)
File "D:\sd-webui-aki-v4\py310\lib\site-packages\PIL\Image.py", line 2428, in save
fp = builtins.open(filename, "w+b")
FileNotFoundError: [Errno 2] No such file or directory: 'outputs\\train_tools\\projects\\yangmi\\versions\\v1\\trains\\chilloutmix_NiPrunedFp32Fix-bs-1-ep-6-op-Lion-lr-0_0001-net-64-ap-64\\yangmi-v1\\images\\xyz_grid-0000-1944501389-_lora_yangmi-v1_0.6_, best quality,Amazing,finely detail,extremely detailed CG unity 8k wallpaper.tmp'
提示:Python 运行时抛出了一个异常。请检查疑难解答页面。
Train Tools: in get_checkpoint_preview_images: project: yangmi v1 chilloutmix_NiPrunedFp32Fix-bs-1-ep-6-op-Lion-lr-0_0001-net-64-ap-64 yangmi-v1: xyz_grid 0, sub_grid 0, all_img 0
sd-webui: commit: 22bcc7be checkpoint: 8838e0d1fb
sd-webui-train-tools: ver e60b048
Python: ver 3.10.6
The UI is always loading and doesn't display properly, even when extensions are added.
The UI only shows the passage of time.
Also, disabling other extensions does not cure this infinite loading problem.
Train Tools: get_project_list: outputs\train_tools\projects\hangge
Train Tools: get_project_version_list: outputs\train_tools\projects\hangge\versions\1.0
Train Tools: ui_refresh_project: ['hangge']
Train Tools: on_ui_change_project_version_click: hangge 1.0
Train Tools: on_ui_change_project_click: hangge
Train Tools: get_project_version_list: outputs\train_tools\projects\hangge\versions\1.0
Train Tools: unknown base model
Train Tools: unknown base model
Train Tools: unknown base model
Train Tools: unknown base model
*** Error completing request
*** Arguments: ('task(e1euh7udxusotk0)', 'hangge', '1.0', None, 1.0, 20.0, 500.0, False, ['Lion'], '0.0002,0.0003,0.0004,0.0005', 128.0, 64.0, 500.0, 'fp16', True, False, False, 'best quality,Amazing,finely detail,extremely detailed CG unity 8k wallpaper', 'low quality', ['Euler a'], '28', 512, 512, 1, 1, '10', '-1', '0.6,0.7,0.8,1') {}
Traceback (most recent call last):
File "D:\happy\stable-diffusion-webui\modules\call_queue.py", line 58, in f
res = list(func(*args, **kwargs))
File "D:\happy\stable-diffusion-webui\modules\call_queue.py", line 37, in f
res = func(*args, **kwargs)
File "D:\happy\stable-diffusion-webui\extensions\sd-webui-train-tools\liasece_sd_webui_train_tools\train_ui.py", line 147, in on_train_begin_click
return [None]+gr_update_trains_area_list(project, version, train_name)+["done"]
UnboundLocalError: local variable 'train_name' referenced before assignment
Traceback (most recent call last):
File "D:\happy\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 422, in run_predict
output = await app.get_blocks().process_api(
File "D:\happy\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1326, in process_api
data = self.postprocess_data(fn_index, result["prediction"], state)
File "D:\happy\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1257, in postprocess_data
assert isinstance(
AssertionError: <class 'gradio.layouts.Box'> Component with id 1491 not a valid output component.
Error loading script: train_tools.py
Traceback (most recent call last):
File "/home/ubuntu/stable-diffusion-webui/modules/scripts.py", line 256, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File "/home/ubuntu/stable-diffusion-webui/modules/script_loading.py", line 11, in load_module
module_spec.loader.exec_module(module)
File "", line 848, in exec_module
File "", line 219, in _call_with_frames_removed
File "/home/ubuntu/stable-diffusion-webui/extensions/sd-webui-train-tools/scripts/train_tools.py", line 7, in
from liasece_sd_webui_train_tools.ui import *
File "/home/ubuntu/stable-diffusion-webui/extensions/sd-webui-train-tools/liasece_sd_webui_train_tools/ui.py", line 8, in
from liasece_sd_webui_train_tools.util import *
File "/home/ubuntu/stable-diffusion-webui/extensions/sd-webui-train-tools/liasece_sd_webui_train_tools/util.py", line 12, in
def readImages(inputPath: str, level: int = 0, include_pre_level: bool = False, endswith :str | list[str] = [".png",".jpg",".jpeg",".bmp",".webp"], startswith: str | list[str] = None) -> list[Image.Image]:
TypeError: 'type' object is not subscriptable
[Dataset 0]
loading image sizes.
make buckets
number of images (including repeats) / 各bucketの画像枚数(繰り返し回数を含む)
bucket 0: resolution (512, 512), count: 512
mean ar error (without repeats): 0.0
prepare accelerator
Using accelerator 0.15.0 or above.
load StableDiffusion checkpoint
loading u-net:
loading vae:
loading text encoder:
Replace CrossAttention.forward to use xformers
[Dataset 0]
caching latents.
import network module: networks.lora
Train Tools: train.train error No module named 'networks.lora'
Traceback (most recent call last):
File "E:\AI\stablediffusion\sd-webui-aki-v4\extensions\sd-webui-train-tools\liasece_sd_webui_train_tools\train_ui.py", line 124, in on_train_begin_click
train.train(cfg)
File "E:\AI\stablediffusion\sd-webui-aki-v4\extensions\sd-webui-train-tools\liasece_sd_webui_train_tools\train.py", line 37, in train
train_network.train(args)
File "E:\AI\stablediffusion\sd-webui-aki-v4\extensions\sd-webui-train-tools\liasece_sd_webui_train_tools\sd_scripts\train_network.py", line 153, in train
network_module = importlib.import_module(args.network_module)
File "importlib_init_.py", line 126, in import_module
File "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
File "", line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'networks.lora'
I tried to install the extension on vladmandic's automatic. When I restarted the server I got the following error and could not launch the server.
> H:\vladmandic\automatic>webui.bat --upgrade --lowvram
Using VENV: H:\vladmandic\automatic\venv
20:47:30-406615 INFO Starting SD.Next
20:47:30-415755 INFO Python 3.10.6 on Windows
20:47:30-502758 INFO Version: c02ccc4f Tue Jun 20 13:49:00 2023 +0300
20:47:31-051184 INFO Updating main repository
20:47:35-082433 INFO Upgraded to version: 9740b9d2 Thu Jun 22 07:46:48 2023 -0400
20:47:35-137285 INFO Using CPU-only Torch
20:47:37-506274 INFO Torch 2.0.0+cpu
20:47:37-725231 INFO Verifying requirements
20:47:37-752159 INFO Verifying packages
20:47:37-755152 INFO Installing repositories
20:47:42-667844 INFO Installing submodules
20:47:47-591243 INFO Updating submodules
20:49:14-713510 INFO Extension installed packages: sd-webui-train-tools
['opencv-python-headless==4.7.0.72', 'albumentations==1.3.1',
'scikit-learn==1.2.2', 'joblib==1.2.0', 'diffusers==0.10.2',
'qudida==0.0.4']
20:49:21-844062 INFO Extensions enabled: ['a1111-sd-webui-lycoris', 'clip-interrogator-ext',
'LDSR', 'Lora', 'multidiffusion-upscaler-for-automatic1111', 'ScuNET',
'sd-dynamic-thresholding', 'sd-extension-aesthetic-scorer',
'sd-extension-steps-animation', 'sd-extension-system-info',
'sd-webui-agent-scheduler', 'sd-webui-controlnet',
'sd-webui-model-converter', 'seed_travel', 'stable-diffusion-webui-rembg',
'SwinIR', 'sd-webui-infinite-image-browsing', 'sd-webui-train-tools',
'sd_civitai_extension']
20:49:21-859588 INFO Updating Wiki
20:49:24-020204 INFO Extension preload: 0.0s
H:\vladmandic\automatic\extensions-builtin
20:49:24-027076 INFO Extension preload: 0.0s H:\vladmandic\automatic\extensions
20:49:24-049928 INFO Server arguments: ['--upgrade', '--lowvram']
No module 'xformers'. Proceeding without it.
Error in sys.excepthook:
Traceback (most recent call last):
File "H:\vladmandic\automatic\venv\lib\site-packages\rich\traceback.py", line 103, in excepthook
Traceback.from_exception(
File "H:\vladmandic\automatic\venv\lib\site-packages\rich\traceback.py", line 346, in from_exception
return cls(
File "H:\vladmandic\automatic\venv\lib\site-packages\rich\traceback.py", line 280, in init
for suppress_entity in suppress:
TypeError: 'module' object is not iterable
Original exception was:
Traceback (most recent call last):
File "H:\vladmandic\automatic\launch.py", line 189, in
instance = start_server(immediate=True, server=None)
File "H:\vladmandic\automatic\launch.py", line 136, in start_server
module_spec.loader.exec_module(server)
File "", line 883, in exec_module
File "", line 241, in call_with_frames_removed
File "H:\vladmandic\automatic\webui.py", line 45, in
from modules import shared, extensions, extra_networks, ui_tempdir, ui_extra_networks, modelloader
File "H:\vladmandic\automatic\modules\ui_extra_networks.py", line 8, in
from modules.generation_parameters_copypaste import image_from_url_text
File "H:\vladmandic\automatic\modules\generation_parameters_copypaste.py", line 10, in
from modules import shared, ui_tempdir, script_callbacks, images
File "H:\vladmandic\automatic\modules\images.py", line 17, in
from modules import sd_samplers, shared, script_callbacks, errors, paths
File "H:\vladmandic\automatic\modules\sd_samplers.py", line 1, in
from modules import sd_samplers_compvis, sd_samplers_kdiffusion, sd_samplers_diffusors, shared
File "H:\vladmandic\automatic\modules\sd_samplers_diffusors.py", line 1, in
from diffusers import (
ImportError: cannot import name 'DEISMultistepScheduler' from 'diffusers' (H:\vladmandic\automatic\venv\lib\site-packages\diffusers_init.py)
I guessed that the new install went wrong. So I deleted sd-webui-train-tools folder completely under automatic\extensions directory. Then I launched the server again and got this error.
>webui.bat --upgrade --lowvram
Using VENV: H:\vladmandic\automatic\venv
21:18:55-668066 INFO Starting SD.Next
21:18:55-683684 INFO Python 3.10.6 on Windows
21:18:55-777386 INFO Version: 9740b9d2 Thu Jun 22 07:46:48 2023 -0400
21:18:56-183540 INFO Using CPU-only Torch
21:18:58-401768 INFO Torch 2.0.0+cpu
21:18:58-682952 INFO Disabled extensions-builtin: ['stable-diffusion-webui-images-browser']
21:18:58-682952 INFO Enabled extensions-builtin: ['a1111-sd-webui-lycoris',
'clip-interrogator-ext', 'LDSR', 'Lora',
'multidiffusion-upscaler-for-automatic1111', 'ScuNET',
'sd-dynamic-thresholding', 'sd-extension-aesthetic-scorer',
'sd-extension-steps-animation', 'sd-extension-system-info',
'sd-webui-agent-scheduler', 'sd-webui-controlnet',
'sd-webui-model-converter', 'seed_travel', 'stable-diffusion-webui-rembg',
'SwinIR']
21:18:58-714197 INFO Disabled extensions: ['stable-diffusion-webui-images-browser']
21:18:58-714197 INFO Enabled extensions: ['sd-webui-infinite-image-browsing',
'sd_civitai_extension']
21:18:58-714197 INFO No changes detected: Quick launch active
21:18:58-729818 INFO Extension preload: 0.0s
H:\vladmandic\automatic\extensions-builtin
21:18:58-729818 INFO Extension preload: 0.0s H:\vladmandic\automatic\extensions
21:18:58-745440 INFO Server arguments: ['--upgrade', '--lowvram']
No module 'xformers'. Proceeding without it.
Error in sys.excepthook:
Traceback (most recent call last):
File "H:\vladmandic\automatic\venv\lib\site-packages\rich\traceback.py", line 103, in excepthook
Traceback.from_exception(
File "H:\vladmandic\automatic\venv\lib\site-packages\rich\traceback.py", line 346, in from_exception
return cls(
File "H:\vladmandic\automatic\venv\lib\site-packages\rich\traceback.py", line 280, in init
for suppress_entity in suppress:
TypeError: 'module' object is not iterable
Original exception was:
Traceback (most recent call last):
File "H:\vladmandic\automatic\launch.py", line 189, in
instance = start_server(immediate=True, server=None)
File "H:\vladmandic\automatic\launch.py", line 136, in start_server
module_spec.loader.exec_module(server)
File "", line 883, in exec_module
File "", line 241, in call_with_frames_removed
File "H:\vladmandic\automatic\webui.py", line 45, in
from modules import shared, extensions, extra_networks, ui_tempdir, ui_extra_networks, modelloader
File "H:\vladmandic\automatic\modules\ui_extra_networks.py", line 8, in
from modules.generation_parameters_copypaste import image_from_url_text
File "H:\vladmandic\automatic\modules\generation_parameters_copypaste.py", line 10, in
from modules import shared, ui_tempdir, script_callbacks, images
File "H:\vladmandic\automatic\modules\images.py", line 17, in
from modules import sd_samplers, shared, script_callbacks, errors, paths
File "H:\vladmandic\automatic\modules\sd_samplers.py", line 1, in
from modules import sd_samplers_compvis, sd_samplers_kdiffusion, sd_samplers_diffusors, shared
File "H:\vladmandic\automatic\modules\sd_samplers_diffusors.py", line 1, in
from diffusers import (
ImportError: cannot import name 'DEISMultistepScheduler' from 'diffusers' (H:\vladmandic\automatic\venv\lib\site-packages\diffusers_init.py)
Did the install change anything other than the files under under automatic\extensions\sd-webui-train-tools?
怀疑是插件冲突了,没有思路从哪里去看,请好心人帮忙解答一下,感激!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.