Linaqruf / kohya-trainer

Adapted from https://note.com/kohya_ss/n/nbf7ce8d80f29 for easier cloning
Apache License 2.0
1.84k stars 302 forks source link

Process Error #192

Open AIShank opened 1 year ago

AIShank commented 1 year ago

Getting this error when trying to start training a LoRa.

╭───────────────────── Traceback (most recent call last) ──────────────────────╮ │ /content/kohya-trainer/train_network.py:752 in │ │ │ │ 749 │ args = parser.parse_args() │ │ 750 │ args = train_util.read_config_from_file(args, parser) │ │ 751 │ │ │ ❱ 752 │ train(args) │ │ 753 │ │ │ │ /content/kohya-trainer/train_network.py:225 in train │ │ │ │ 222 │ │ print("Deprecated: use prepare_optimizer_params(text_encoder_l │ │ 223 │ │ trainable_params = network.prepare_optimizerparams(args.text │ │ 224 │ │ │ ❱ 225 │ optimizer_name, optimizer_args, optimizer = train_util.get_optimiz │ │ 226 │ │ │ 227 │ # dataloaderを準備する │ │ 228 │ # DataLoaderのプロセス数:0はメインプロセスになる │ │ │ │ /content/kohya-trainer/library/train_util.py:2377 in get_optimizer │ │ │ │ 2374 │ if args.optimizer_args is not None and len(args.optimizer_args) > │ │ 2375 │ │ for arg in args.optimizer_args: │ │ 2376 │ │ │ key, value = arg.split("=") │ │ ❱ 2377 │ │ │ value = ast.literal_eval(value) │ │ 2378 │ │ │ │ │ 2379 │ │ │ # value = value.split(",") │ │ 2380 │ │ │ # for i in range(len(value)): │ │ │ │ /usr/lib/python3.9/ast.py:62 in literal_eval │ │ │ │ 59 │ sets, booleans, and None. │ │ 60 │ """ │ │ 61 │ if isinstance(node_or_string, str): │ │ ❱ 62 │ │ node_or_string = parse(node_or_string, mode='eval') │ │ 63 │ if isinstance(node_or_string, Expression): │ │ 64 │ │ node_or_string = node_or_string.body │ │ 65 │ def _raise_malformed_node(node): │ │ │ │ /usr/lib/python3.9/ast.py:50 in parse │ │ │ │ 47 │ elif feature_version is None: │ │ 48 │ │ feature_version = -1 │ │ 49 │ # Else it should be an int giving the minor version for 3.x. │ │ ❱ 50 │ return compile(source, filename, mode, flags, │ │ 51 │ │ │ │ _feature_version=feature_version) │ │ 52 │ │ 53 │ ╰──────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────╮ │ 0.1 │ │ ▲ │ ╰──────────────────────────────────────────────────────────────────────────────╯ IndentationError: unexpected indent ╭───────────────────── Traceback (most recent call last) ──────────────────────╮ │ /usr/local/bin/accelerate:8 in │ │ │ │ 5 from accelerate.commands.accelerate_cli import main │ │ 6 if name == 'main': │ │ 7 │ sys.argv[0] = re.sub(r'(-script.pyw|.exe)?$', '', sys.argv[0]) │ │ ❱ 8 │ sys.exit(main()) │ │ 9 │ │ │ │ /usr/local/lib/python3.9/dist-packages/accelerate/commands/accelerate_cli.py │ │ :45 in main │ │ │ │ 42 │ │ exit(1) │ │ 43 │ │ │ 44 │ # Run │ │ ❱ 45 │ args.func(args) │ │ 46 │ │ 47 │ │ 48 if name == "main": │ │ │ │ /usr/local/lib/python3.9/dist-packages/accelerate/commands/launch.py:1104 in │ │ launch_command │ │ │ │ 1101 │ elif defaults is not None and defaults.compute_environment == Com │ │ 1102 │ │ sagemaker_launcher(defaults, args) │ │ 1103 │ else: │ │ ❱ 1104 │ │ simple_launcher(args) │ │ 1105 │ │ 1106 │ │ 1107 def main(): │ │ │ │ /usr/local/lib/python3.9/dist-packages/accelerate/commands/launch.py:567 in │ │ simple_launcher │ │ │ │ 564 │ process = subprocess.Popen(cmd, env=current_env) │ │ 565 │ process.wait() │ │ 566 │ if process.returncode != 0: │ │ ❱ 567 │ │ raise subprocess.CalledProcessError(returncode=process.return │ │ 568 │ │ 569 │ │ 570 def multi_gpu_launcher(args): │ ╰──────────────────────────────────────────────────────────────────────────────╯ CalledProcessError: Command '['/usr/bin/python3', 'train_network.py', '--sample_prompts=/content/LoRA/config/sample_prompt.txt', '--dataset_config=/content/LoRA/config/dataset_config.toml', '--config_file=/content/LoRA/config/config_file.toml']' returned non-zero exit status 1.

Linaqruf commented 1 year ago

can i see the config/dataset toml file?

klintan96 commented 1 year ago

this is an error because of the model. I had the same error with revAnimated_v121