not work in kohya_ss

#36
by shunsso - opened

Traceback (most recent call last):
File "/content/kohya_ss/./train_network.py", line 1012, in
trainer.train(args)
File "/content/kohya_ss/./train_network.py", line 228, in train
model_version, text_encoder, vae, unet = self.load_target_model(args, weight_dtype, accelerator)
File "/content/kohya_ss/./train_network.py", line 102, in load_target_model
text_encoder, vae, unet, _ = train_util.load_target_model(args, weight_dtype, accelerator)
File "/content/kohya_ss/library/train_util.py", line 3917, in load_target_model
text_encoder, vae, unet, load_stable_diffusion_format = _load_target_model(
File "/content/kohya_ss/library/train_util.py", line 3867, in _load_target_model
pipe = StableDiffusionPipeline.from_pretrained(name_or_path, tokenizer=None, safety_checker=None)
File "/usr/local/lib/python3.10/dist-packages/diffusers/pipelines/pipeline_utils.py", line 1105, in from_pretrained
loaded_sub_model = load_sub_model(
File "/usr/local/lib/python3.10/dist-packages/diffusers/pipelines/pipeline_utils.py", line 472, in load_sub_model
loaded_sub_model = load_method(os.path.join(cached_folder, name), **loading_kwargs)
File "/usr/local/lib/python3.10/dist-packages/diffusers/models/modeling_utils.py", line 636, in from_pretrained
model = cls.from_config(config, **unused_kwargs)
File "/usr/local/lib/python3.10/dist-packages/diffusers/configuration_utils.py", line 254, in from_config
model = cls(**init_dict)
File "/usr/local/lib/python3.10/dist-packages/diffusers/configuration_utils.py", line 636, in inner_init
init(self, *args, **init_kwargs)
File "/usr/local/lib/python3.10/dist-packages/diffusers/models/unet_2d_condition.py", line 440, in init
down_block = get_down_block(
File "/usr/local/lib/python3.10/dist-packages/diffusers/models/unet_2d_blocks.py", line 119, in get_down_block
return CrossAttnDownBlock2D(
File "/usr/local/lib/python3.10/dist-packages/diffusers/models/unet_2d_blocks.py", line 1001, in init
Transformer2DModel(
File "/usr/local/lib/python3.10/dist-packages/diffusers/configuration_utils.py", line 636, in inner_init
init(self, *args, **init_kwargs)
File "/usr/local/lib/python3.10/dist-packages/diffusers/models/transformer_2d.py", line 191, in init
for d in range(num_layers)
TypeError: 'list' object cannot be interpreted as an integer
Traceback (most recent call last):
File "/usr/local/bin/accelerate", line 8, in
sys.exit(main())
File "/usr/local/lib/python3.10/dist-packages/accelerate/commands/accelerate_cli.py", line 47, in main
args.func(args)
File "/usr/local/lib/python3.10/dist-packages/accelerate/commands/launch.py", line 986, in launch_command
simple_launcher(args)
File "/usr/local/lib/python3.10/dist-packages/accelerate/commands/launch.py", line 628, in simple_launcher
raise subprocess.CalledProcessError(returncode=process.returncode, cmd=cmd)
subprocess.CalledProcessError: Command '['/usr/bin/python3', './train_network.py', '--enable_bucket', '--min_bucket_reso=256', '--max_bucket_reso=2048', '--pretrained_model_name_or_path=segmind/SSD-1B', '--train_data_dir=/content/drive/MyDrive/AI/img', '--resolution=512,512', '--output_dir=/content/drive/MyDrive/AI/model', '--network_alpha=8', '--save_model_as=safetensors', '--network_module=networks.lora', '--text_encoder_lr=5e-05', '--unet_lr=0.0001', '--network_dim=8', '--output_name=ssd1b', '--lr_scheduler_num_cycles=1', '--no_half_vae', '--learning_rate=0.0001', '--lr_scheduler=cosine', '--train_batch_size=1', '--max_train_steps=5000', '--save_every_n_epochs=1', '--mixed_precision=fp16', '--save_precision=fp16', '--caption_extension=.txt', '--optimizer_type=AdamW8bit', '--max_data_loader_n_workers=0', '--bucket_reso_steps=64', '--mem_eff_attn', '--gradient_checkpointing', '--bucket_no_upscale', '--noise_offset=0.0']' returned non-zero exit status 1.

Segmind org

Kohya is not supported AFAIK. There was a PR for support a while ago, I'm not sure of the status at the moment. You can train with diffusers.

I also tried it, but it could not be trained due to running out of memory. Although I tried to improve it, it broke it in Colab. Do you have a ready-made notebook that I can use?

Sign up or log in to comment