kohya-ss / sd-scripts

Apache License 2.0
4.95k stars 830 forks source link

aksing for help: error accurs after trainning activated.. #338

Open samsoap-mg opened 1 year ago

samsoap-mg commented 1 year ago

Hey guys, what can I do? thanks so much.

To create a public link, set share=True in launch(). Folder 100_test: 12 images found Folder 100_test: 1200 steps max_train_steps = 1200 stop_text_encoder_training = 0 lr_warmup_steps = 120 accelerate launch --num_cpu_threads_per_process=2 "train_network.py" --enable_bucket --pretrained_model_name_or_path="C:/Users/zyb/stable-diffusion-webui/models/Stable-diffusion/Realistic_Vision_V1.4.ckpt" --train_data_dir="E:/AI/lora training data/100_zb/image" --resolution=512,512 --output_dir="E:/AI/lora training data/100_zb/model" --logging_dir="E:/AI/lora training data/100_zb/log" --network_alpha="1" --save_model_as=safetensors --network_module=networks.lora --text_encoder_lr=5e-5 --unet_lr=0.0001 --network_dim=8 --output_name="last" --lr_scheduler_num_cycles="1" --learning_rate="0.0001" --lr_scheduler="cosine" --lr_warmup_steps="120" --train_batch_size="1" --max_train_steps="1200" --save_every_n_epochs="1" --mixed_precision="fp16" --save_precision="fp16" --cache_latents --optimizer_type="AdamW8bit" --max_data_loader_n_workers="0" --bucket_reso_steps=64 --xformers --bucket_no_upscale Could not find module 'E:\AI\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:\AI\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 prepare tokenizer Use DreamBooth method. Traceback (most recent call last): File "E:\AI\kohya\kohya_ss\train_network.py", line 699, in train(args) File "E:\AI\kohya\kohya_ss\train_network.py", line 101, in train train_dataset_group = config_util.generate_dataset_group_by_blueprint(blueprint.dataset_group) File "E:\AI\kohya\kohya_ss\library\config_util.py", line 369, in generate_dataset_group_by_blueprint subsets = [subset_klass(asdict(subset_blueprint.params)) for subset_blueprint in dataset_blueprint.subsets] File "E:\AI\kohya\kohya_ss\library\config_util.py", line 369, in subsets = [subset_klass(asdict(subset_blueprint.params)) for subset_blueprint in dataset_blueprint.subsets] TypeError: DreamBoothSubset.init() missing 2 required positional arguments: 'token_warmup_min' and 'token_warmup_step' Traceback (most recent call last): File "C:\Users\zyb\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\zyb\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "E:\AI\kohya\kohya_ss\venv\Scripts\accelerate.exe__main__.py", line 7, in File "E:\AI\kohya\kohya_ss\venv\lib\site-packages\accelerate\commands\accelerate_cli.py", line 45, in main args.func(args) File "E:\AI\kohya\kohya_ss\venv\lib\site-packages\accelerate\commands\launch.py", line 1104, in launch_command simple_launcher(args) File "E:\AI\kohya\kohya_ss\venv\lib\site-packages\accelerate\commands\launch.py", line 567, in simple_launcher raise subprocess.CalledProcessError(returncode=process.returncode, cmd=cmd) subprocess.CalledProcessError: Command '['E:\AI\kohya\kohya_ss\venv\Scripts\python.exe', 'train_network.py', '--enable_bucket', '--pretrained_model_name_or_path=C:/Users/zyb/stable-diffusion-webui/models/Stable-diffusion/Realistic_Vision_V1.4.ckpt', '--train_data_dir=E:/AI/lora training data/100_zb/image', '--resolution=512,512', '--output_dir=E:/AI/lora training data/100_zb/model', '--logging_dir=E:/AI/lora training data/100_zb/log', '--network_alpha=1', '--save_model_as=safetensors', '--network_module=networks.lora', '--text_encoder_lr=5e-5', '--unet_lr=0.0001', '--network_dim=8', '--output_name=last', '--lr_scheduler_num_cycles=1', '--learning_rate=0.0001', '--lr_scheduler=cosine', '--lr_warmup_steps=120', '--train_batch_size=1', '--max_train_steps=1200', '--save_every_n_epochs=1', '--mixed_precision=fp16', '--save_precision=fp16', '--cache_latents', '--optimizer_type=AdamW8bit', '--max_data_loader_n_workers=0', '--bucket_reso_steps=64', '--xformers', '--bucket_no_upscale']' returned non-zero exit status 1.

DKnight54 commented 1 year ago

TypeError: DreamBoothSubset.init() missing 2 required positional arguments: 'token_warmup_min' and 'token_warmup_step'

From this line here, looks like you need to give two more arguements related to the token warmup.

If you don't plan to use it, I think you can just add the arguements withe the following values: --token_warmup_min 1 --token_warmup_step 0

kohya-ss commented 1 year ago

Please upgrade the repo if you haven't upgraded after git pull: pip install --use-pep517 --upgrade -r requirements.txt