kohya-ss / kohya-ss/sd-scripts
raise subprocess.CalledProcessError(returncode=process.returncode, cmd=cmd) and returned non-zero exit status 1
- Dominant language
- Python
- Stars
- 7.2k
- Forks
- 1.2k
- Avg merge
- 11m
- Merged PRs (30d)
- 2
Description
Load CSS...
Running on local URL: http://127.0.0.1:7860
To create a public link, set `share=True` in `launch()`.
Loading config...
Traceback (most recent call last):
File "C:\Users\stabl\Desktop\kohya\kohya_ss\venv\lib\site-packages\gradio\routes.py", line 337, in run_predict
output = await app.get_blocks().process_api(
File "C:\Users\stabl\Desktop\kohya\kohya_ss\venv\lib\site-packages\gradio\blocks.py", line 1015, in process_api
result = await self.call_function(
File "C:\Users\stabl\Desktop\kohya\kohya_ss\venv\lib\site-packages\gradio\blocks.py", line 833, in call_function
prediction = await anyio.to_thread.run_sync(
File "C:\Users\stabl\Desktop\kohya\kohya_ss\venv\lib\site-packages\anyio\to_thread.py", line 31, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File "C:\Users\stabl\Desktop\kohya\kohya_ss\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 937, in run_sync_in_worker_thread
return await future
File "C:\Users\stabl\Desktop\kohya\kohya_ss\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 867, in run
result = context.run(func, *args)
File "C:\Users\stabl\Desktop\kohya\kohya_ss\dreambooth_gui.py", line 213, in open_configuration
my_data = update_optimizer(my_data)
UnboundLocalError: local variable 'my_data' referenced before assignment
Loading config...
Folder 20_cst girl: 320 steps
max_train_steps = 160
stop_text_encoder_training = 0
lr_warmup_steps = 0
accelerate launch --num_cpu_threads_per_process=2 "train_network.py" --pretrained_model_name_or_path="C:/Users/stabl/Downloads/ACertainty.ckpt" --train_data_dir="C:/Users/stabl/Downloads/lora1/sozai" --resolution=512,512 --output_dir="C:/Users/stabl/Downloads/lora1/output" --logging_dir="C:/Users/stabl/Desktop/kohya" --network_alpha="128" --save_model_as=safetensors --network_module=networks.lora --text_encoder_lr=5e-5 --unet_lr=0.0001 --network_dim=128 --output_name="cst1" --lr_scheduler_num_cycles="1" --learning_rate="0.0001" --lr_scheduler="constant" --train_batch_size="2" --max_train_steps="160" --save_every_n_epochs="1" --mixed_precision="fp16" --save_precision="fp16" --seed="1234" --caption_extension=".txt" --cache_latents --optimizer_type="AdamW8bit" --max_data_loader_n_workers="1" --clip_skip=2 --bucket_reso_steps=64 --xformers
prepare tokenizer
Use DreamBooth method.
Traceback (most recent call last):
File "C:\Users\stabl\Desktop\kohya\kohya_ss\train_network.py", line 507, in
train(args)
File "C:\Users\stabl\Desktop\kohya\kohya_ss\train_network.py", line 61, in train
train_dataset = DreamBoothDataset(args.train_batch_size, args.train_data_dir, args.reg_data_dir,
TypeError: DreamBoothDataset.__init__() takes 13 positional arguments but 21 were given
Traceback (most recent call last):
File "C:\Users\stabl\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\stabl\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\Users\stabl\Desktop\kohya\kohya_ss\venv\Scripts\accelerate.exe\__main__.py", line 7, in
File "C:\Users\stabl\Desktop\kohya\kohya_ss\venv\lib\site-packages\accelerate\commands\accelerate_cli.py", line 45, in main
args.func(args)
File "C:\Users\stabl\Desktop\kohya\kohya_ss\venv\lib\site-packages\accelerate\commands\launch.py", line 1104, in launch_command
simple_launcher(args)
File "C:\Users\stabl\Desktop\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 '['C:\\Users\\stabl\\Desktop\\kohya\\kohya_ss\\venv\\Scripts\\python.exe', 'train_network.py', '--pretrained_model_name_or_path=C:/Users/stabl/Downloads/ACertainty.ckpt', '--train_data_dir=C:/Users/stabl/Downloads/lora1/sozai', '--resolution=512,512', '--output_dir=C:/Users/stabl/Downloads/lora1/output', '--logging_dir=C:/Users/stabl/Desktop/kohya', '--network_alpha=128', '--save_model_as=safetensors', '--network_module=networks.lora', '--text_encoder_lr=5e-5', '--unet_lr=0.0001', '--network_dim=128', '--output_name=cst1', '--lr_scheduler_num_cycles=1', '--learning_rate=0.0001', '--lr_scheduler=constant', '--train_batch_size=2', '--max_train_steps=160', '--save_every_n_epochs=1', '--mixed_precision=fp16', '--save_precision=fp16', '--seed=1234', '--caption_extension=.txt', '--cache_latents', '--optimizer_type=AdamW8bit', '--max_data_loader_n_workers=1', '--clip_skip=2', '--bucket_reso_steps=64', '--xformers']' returned non-zero exit status 1.
I have tried the various methods posted for this error, but to no avail.
Does anyone have any good wisdom to share?
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with dreambooth_gui.py at open_configuration and train_network.py at train, then inspect the DreamBoothDataset constructor used by train_network.py. Reproduce the reported configuration and training flow to determine whether the unbound local variable and argument-count error are related. Done means the flow proceeds without either traceback and no longer ends with the reported subprocess error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100