From 91e19ca9d980090e6801ecc033e94da0fc8d8a04 Mon Sep 17 00:00:00 2001 From: bmaltais Date: Sun, 12 Mar 2023 20:36:58 -0400 Subject: [PATCH] Fix issue with kohya locon not training the convolution layers --- README.md | 6 +++++- lora_gui.py | 2 +- requirements.txt | 2 +- tools/lycoris_locon_extract.py | 16 +++++++++++++++- 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index d416ac8..a8a6596 100644 --- a/README.md +++ b/README.md @@ -189,7 +189,11 @@ This will store your a backup file with your current locally installed pip packa ## Change History -* 2023.03/12 (v21.2.3): +* 2023/03/12 (v21.2.4): + - Fix issue with kohya locon not training the convolution layers + - Update LyCORIS module version + - Update LyCORYS locon extract tool +* 2023/03/12 (v21.2.3): - Add validation that all requirements are met before starting the GUI. * 2023/03/11 (v21.2.2): - Add support for LoRA LoHa type. See https://github.com/KohakuBlueleaf/LyCORIS for more details. diff --git a/lora_gui.py b/lora_gui.py index 89f97fb..39e690f 100644 --- a/lora_gui.py +++ b/lora_gui.py @@ -507,7 +507,7 @@ def train_model( if LoRA_type == 'Kohya LoCon': run_cmd += f' --network_module=networks.lora' run_cmd += ( - f' --network_args "conv_lora_dim={conv_dim}" "conv_alpha={conv_alpha}"' + f' --network_args "conv_dim={conv_dim}" "conv_alpha={conv_alpha}"' ) if LoRA_type == 'Standard': run_cmd += f' --network_module=networks.lora' diff --git a/requirements.txt b/requirements.txt index df32424..8e47439 100644 --- a/requirements.txt +++ b/requirements.txt @@ -25,6 +25,6 @@ timm==0.6.12 huggingface-hub==0.12.0 tensorflow==2.10.1 # For locon support -lycoris_lora==0.0.9 +lycoris_lora==0.1.2 # for kohya_ss library . \ No newline at end of file diff --git a/tools/lycoris_locon_extract.py b/tools/lycoris_locon_extract.py index 308dcf1..2b10375 100644 --- a/tools/lycoris_locon_extract.py +++ b/tools/lycoris_locon_extract.py @@ -69,6 +69,18 @@ def get_args(): "--conv_quantile", help="singular value quantile for conv layer quantile mode", default=1., type=float ) + parser.add_argument( + "--use_sparse_bias", help="enable sparse bias", + default=False, action="store_true" + ) + parser.add_argument( + "--sparsity", help="sparsity for sparse bias", + default=0.98, type=float + ) + parser.add_argument( + "--disable_cp", help="don't use cp decomposition", + default=False, action="store_true" + ) return parser.parse_args() ARGS = get_args() @@ -102,7 +114,9 @@ def main(): base, db, args.mode, linear_mode_param, conv_mode_param, - args.device + args.device, + args.use_sparse_bias, args.sparsity, + # not args.disable_small_conv ) if args.safetensors: