【AI绘画】最佳人物模型训练!保姆式LoRA模型训练教程 一键包发布

prepare tokenizer
update token length: 225
Use DreamBooth method.
prepare train images.
found directory 6_qubit contains 113 image files
678 train images with repeating.
loading image sizes.
100%|██████████████████████████████████████████████████████████████████████████████| 113/113 [00:00<00:00, 3149.99it/s]
make buckets
number of images (including repeats) / 各bucketの画像枚数(繰り返し回数を含む)
bucket 0: resolution (320, 320), count: 678
mean ar error (without repeats): 0.0
prepare accelerator
Using accelerator 0.15.0 or above.
load Diffusers pretrained models
Traceback (most recent call last):
File "D:\stable diffusion\lora训练\lora-scripts\venv\lib\site-packages\diffusers\configuration_utils.py", line 326, in load_config
config_file = hf_hub_download(
File "D:\stable diffusion\lora训练\lora-scripts\venv\lib\site-packages\huggingface_hub\utils\_validators.py", line 114, in _inner_fn
validate_repo_id(arg_value)
File "D:\stable diffusion\lora训练\lora-scripts\venv\lib\site-packages\huggingface_hub\utils\_validators.py", line 166, in validate_repo_id
raise HFValidationError(
huggingface_hub.utils._validators.HFValidationError: Repo id must be in the form 'repo_name' or 'namespace/repo_name': './sd-models/model.ckpt'. Use `repo_type` argument if needed.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\stable diffusion\lora训练\lora-scripts\sd-scripts\train_network.py", line 548, in <module>
train(args)
File "D:\stable diffusion\lora训练\lora-scripts\sd-scripts\train_network.py", line 156, in train
text_encoder, vae, unet, _ = train_util.load_target_model(args, weight_dtype)
File "D:\stable diffusion\lora训练\lora-scripts\sd-scripts\library\train_util.py", line 1587, in load_target_model
pipe = StableDiffusionPipeline.from_pretrained(args.pretrained_model_name_or_path, tokenizer=None, safety_checker=None)
File "D:\stable diffusion\lora训练\lora-scripts\venv\lib\site-packages\diffusers\pipeline_utils.py", line 454, in from_pretrained
config_dict = cls.load_config(
File "D:\stable diffusion\lora训练\lora-scripts\venv\lib\site-packages\diffusers\configuration_utils.py", line 363, in load_config
raise EnvironmentError(
OSError: We couldn't connect to 'https://huggingface.co' to load this model, couldn't find it in the cached files and it looks like ./sd-models/model.ckpt is not the path to a directory containing a model_index.json file.
Checkout your internet connection or see how to run the library in offline mode at 'https://huggingface.co/docs/diffusers/installation#offline-mode'.
Traceback (most recent call last):
File "C:\Users\1\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\1\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "D:\stable diffusion\lora训练\lora-scripts\venv\Scripts\accelerate.exe\__main__.py", line 7, in <module>
File "D:\stable diffusion\lora训练\lora-scripts\venv\lib\site-packages\accelerate\commands\accelerate_cli.py", line 45, in main
args.func(args)
File "D:\stable diffusion\lora训练\lora-scripts\venv\lib\site-packages\accelerate\commands\launch.py", line 1104, in launch_command
simple_launcher(args)
File "D:\stable diffusion\lora训练\lora-scripts\venv\lib\site-packages\accelerate\commands\launch.py", line 567, in simple_launcher
raise subprocess.CalledProcessError(returncode=process.returncode, cmd=cmd)
subprocess.CalledProcessError: Command '['D:\\stable diffusion\\lora训练\\lora-scripts\\venv\\Scripts\\python.exe', './sd-scripts/train_network.py', '--enable_bucket', '--pretrained_model_name_or_path=./sd-models/model.ckpt', '--train_data_dir=./train/qubit', '--output_dir=./output', '--logging_dir=./logs', '--resolution=350,350', '--network_module=networks.lora', '--max_train_epochs=15', '--learning_rate=1e-4', '--unet_lr=1e-4', '--text_encoder_lr=1e-5', '--lr_scheduler=cosine_with_restarts', '--lr_warmup_steps=0', '--network_dim=32', '--network_alpha=32', '--output_name=qubit', '--train_batch_size=1', '--save_every_n_epochs=2', '--mixed_precision=fp16', '--save_precision=fp16', '--seed=1337', '--cache_latents', '--clip_skip=2', '--prior_loss_weight=1', '--max_token_length=225', '--caption_extension=.txt', '--save_model_as=ckpt', '--min_bucket_reso=256', '--max_bucket_reso=1024']' returned non-zero exit status 1.
Train finished
大佬们!求求帮忙看看问题!!刚开始运行就不行了,翻译过来好像看中间有一个错误:
OSError:我们无法连接到'https://huggingface.co'加载此模型,在缓存文件中找不到它,它看起来像/sd models/model.ckpt不是包含modelindex.json文件的目录的路径。
全部代码是这些:
prepare tokenizer
update token length: 225
Use DreamBooth method.
prepare train images.
found directory 6_qubit contains 113 image files
678 train images with repeating.
loading image sizes.
100%|██████████████████████████████████████████████████████████████████████████████| 113/113 [00:00<00:00, 3061.75it/s]
make buckets
number of images (including repeats) / 各bucketの画像枚数(繰り返し回数を含む)
bucket 0: resolution (320, 320), count: 678
mean ar error (without repeats): 0.0
prepare accelerator
Using accelerator 0.15.0 or above.
load Diffusers pretrained models
Traceback (most recent call last):
File "D:\stable diffusion\lora训练\lora-scripts\venv\lib\site-packages\diffusers\configuration_utils.py", line 326, in load_config
config_file = hf_hub_download(
File "D:\stable diffusion\lora训练\lora-scripts\venv\lib\site-packages\huggingface_hub\utils\_validators.py", line 114, in _inner_fn
validate_repo_id(arg_value)
File "D:\stable diffusion\lora训练\lora-scripts\venv\lib\site-packages\huggingface_hub\utils\_validators.py", line 166, in validate_repo_id
raise HFValidationError(
huggingface_hub.utils._validators.HFValidationError: Repo id must be in the form 'repo_name' or 'namespace/repo_name': './sd-models/model.ckpt'. Use `repo_type` argument if needed.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\stable diffusion\lora训练\lora-scripts\sd-scripts\train_network.py", line 548, in <module>
train(args)
File "D:\stable diffusion\lora训练\lora-scripts\sd-scripts\train_network.py", line 156, in train
text_encoder, vae, unet, _ = train_util.load_target_model(args, weight_dtype)
File "D:\stable diffusion\lora训练\lora-scripts\sd-scripts\library\train_util.py", line 1587, in load_target_model
pipe = StableDiffusionPipeline.from_pretrained(args.pretrained_model_name_or_path, tokenizer=None, safety_checker=None)
File "D:\stable diffusion\lora训练\lora-scripts\venv\lib\site-packages\diffusers\pipeline_utils.py", line 454, in from_pretrained
config_dict = cls.load_config(
File "D:\stable diffusion\lora训练\lora-scripts\venv\lib\site-packages\diffusers\configuration_utils.py", line 363, in load_config
raise EnvironmentError(
OSError: We couldn't connect to 'https://huggingface.co' to load this model, couldn't find it in the cached files and it looks like ./sd-models/model.ckpt is not the path to a directory containing a model_index.json file.
Checkout your internet connection or see how to run the library in offline mode at 'https://huggingface.co/docs/diffusers/installation#offline-mode'.
Traceback (most recent call last):
File "C:\Users\1\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\1\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "D:\stable diffusion\lora训练\lora-scripts\venv\Scripts\accelerate.exe\__main__.py", line 7, in <module>
File "D:\stable diffusion\lora训练\lora-scripts\venv\lib\site-packages\accelerate\commands\accelerate_cli.py", line 45, in main
args.func(args)
File "D:\stable diffusion\lora训练\lora-scripts\venv\lib\site-packages\accelerate\commands\launch.py", line 1104, in launch_command
simple_launcher(args)
File "D:\stable diffusion\lora训练\lora-scripts\venv\lib\site-packages\accelerate\commands\launch.py", line 567, in simple_launcher
raise subprocess.CalledProcessError(returncode=process.returncode, cmd=cmd)
subprocess.CalledProcessError: Command '['D:\\stable diffusion\\lora训练\\lora-scripts\\venv\\Scripts\\python.exe', './sd-scripts/train_network.py', '--enable_bucket', '--pretrained_model_name_or_path=./sd-models/model.ckpt', '--train_data_dir=./train/qubit', '--output_dir=./output', '--logging_dir=./logs', '--resolution=350,350', '--network_module=networks.lora', '--max_train_epochs=15', '--learning_rate=1e-4', '--unet_lr=1e-4', '--text_encoder_lr=1e-5', '--lr_scheduler=cosine_with_restarts', '--lr_warmup_steps=0', '--network_dim=32', '--network_alpha=32', '--output_name=qubit', '--train_batch_size=1', '--save_every_n_epochs=2', '--mixed_precision=fp16', '--save_precision=fp16', '--seed=1337', '--cache_latents', '--clip_skip=2', '--prior_loss_weight=1', '--max_token_length=225', '--caption_extension=.txt', '--save_model_as=ckpt', '--min_bucket_reso=256', '--max_bucket_reso=1024']' returned non-zero exit status 1.
Train finished