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

I have an error #204

Open Rimuru79807980 opened 1 year ago

Rimuru79807980 commented 1 year ago

Loading settings from /content/LoRA/config/config_file.toml... /content/LoRA/config/config_file prepare tokenizer update token length: 225 Train with captions. ╭───────────────────── 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:117 in train │ │ │ │ 114 │ │ │ } │ │ 115 │ │ │ 116 │ blueprint = blueprint_generator.generate(user_config, args, tokeni │ │ ❱ 117 │ train_dataset_group = config_util.generate_dataset_group_by_bluepr │ │ 118 │ │ │ 119 │ current_epoch = Value("i", 0) │ │ 120 │ current_step = Value("i", 0) │ │ │ │ /content/kohya-trainer/library/config_util.py:375 in │ │ generate_dataset_group_by_blueprint │ │ │ │ 372 │ dataset_klass = FineTuningDataset │ │ 373 │ │ │ 374 │ subsets = [subset_klass(asdict(subset_blueprint.params)) for sub │ │ ❱ 375 │ dataset = dataset_klass(subsets=subsets, asdict(dataset_blueprin │ │ 376 │ datasets.append(dataset) │ │ 377 │ │ 378 # print info │ │ │ │ /content/kohya-trainer/library/train_util.py:1157 in init │ │ │ │ 1154 │ │ │ │ with open(subset.metadata_file, "rt", encoding="utf-8 │ │ 1155 │ │ │ │ │ metadata = json.load(f) │ │ 1156 │ │ │ else: │ │ ❱ 1157 │ │ │ │ raise ValueError(f"no metadata / メタデータファイルが │ │ 1158 │ │ │ │ │ 1159 │ │ │ if len(metadata) < 1: │ │ 1160 │ │ │ │ print(f"ignore subset with '{subset.metadata_file}': │ ╰──────────────────────────────────────────────────────────────────────────────╯ ValueError: no metadata / メタデータファイルがありません: /content/LoRA/meta_lat.json ╭───────────────────── 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', '--config_file=/content/LoRA/config/config_file.toml']' returned non-zero exit status 1.

foxya27 commented 1 year ago

I have this error too...

Loading settings from /content/LoRA/config/config_file.toml... /content/LoRA/config/config_file prepare tokenizer update token length: 225 Train with captions. ╭───────────────────── 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:117 in train │ │ │ │ 114 │ │ │ } │ │ 115 │ │ │ 116 │ blueprint = blueprint_generator.generate(user_config, args, tokeni │ │ ❱ 117 │ train_dataset_group = config_util.generate_dataset_group_by_bluepr │ │ 118 │ │ │ 119 │ current_epoch = Value("i", 0) │ │ 120 │ current_step = Value("i", 0) │ │ │ │ /content/kohya-trainer/library/config_util.py:375 in │ │ generate_dataset_group_by_blueprint │ │ │ │ 372 │ dataset_klass = FineTuningDataset │ │ 373 │ │ │ 374 │ subsets = [subset_klass(asdict(subset_blueprint.params)) for sub │ │ ❱ 375 │ dataset = dataset_klass(subsets=subsets, asdict(dataset_blueprin │ │ 376 │ datasets.append(dataset) │ │ 377 │ │ 378 # print info │ │ │ │ /content/kohya-trainer/library/train_util.py:1157 in init │ │ │ │ 1154 │ │ │ │ with open(subset.metadata_file, "rt", encoding="utf-8 │ │ 1155 │ │ │ │ │ metadata = json.load(f) │ │ 1156 │ │ │ else: │ │ ❱ 1157 │ │ │ │ raise ValueError(f"no metadata / メタデータファイルが │ │ 1158 │ │ │ │ │ 1159 │ │ │ if len(metadata) < 1: │ │ 1160 │ │ │ │ print(f"ignore subset with '{subset.metadata_file}': │ ╰──────────────────────────────────────────────────────────────────────────────╯ ValueError: no metadata / メタデータファイルがありません: /content/LoRA/meta_lat.json ╭───────────────────── 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.10/dist-packages/accelerate/commands/accelerate_cli.p │ │ y:45 in main │ │ │ │ 42 │ │ exit(1) │ │ 43 │ │ │ 44 │ # Run │ │ ❱ 45 │ args.func(args) │ │ 46 │ │ 47 │ │ 48 if name == "main": │ │ │ │ /usr/local/lib/python3.10/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.10/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', '--config_file=/content/LoRA/config/config_file.toml']' returned non-zero exit status 1.

foxya27 commented 1 year ago

Solved, just use this image