bmaltais / kohya_ss

Apache License 2.0
9.54k stars 1.23k forks source link

traning error #2021

Closed Lecho303 closed 7 months ago

Lecho303 commented 7 months ago

i was set up all the settings,and chose model named:v2-1_768-ema-pruned then the error showed: Traceback (most recent call last): File "C:\Users\ningl\kohya_ss\train_network.py", line 1058, in trainer.train(args) File "C:\Users\ningl\kohya_ss\train_network.py", line 235, in train model_version, text_encoder, vae, unet = self.load_target_model(args, weight_dtype, accelerator) File "C:\Users\ningl\kohya_ss\train_network.py", line 103, in load_target_model textencoder, vae, unet, = train_util.load_target_model(args, weight_dtype, accelerator) File "C:\Users\ningl\kohya_ss\library\train_util.py", line 4113, in load_target_model text_encoder, vae, unet, load_stable_diffusion_format = _load_target_model( File "C:\Users\ningl\kohya_ss\library\train_util.py", line 4074, in _load_target_model pipe = StableDiffusionPipeline.from_pretrained(name_or_path, tokenizer=None, safety_checker=None) File "C:\Users\ningl\kohya_ss\venv\lib\site-packages\huggingface_hub\utils_validators.py", line 118, in _inner_fn return fn(*args, *kwargs) File "C:\Users\ningl\kohya_ss\venv\lib\site-packages\diffusers\pipelines\pipeline_utils.py", line 1096, in from_pretrained cached_folder = cls.download( File "C:\Users\ningl\kohya_ss\venv\lib\site-packages\huggingface_hub\utils_validators.py", line 118, in _inner_fn return fn(args, **kwargs) File "C:\Users\ningl\kohya_ss\venv\lib\site-packages\diffusers\pipelines\pipeline_utils.py", line 1656, in download info = model_info(pretrained_model_name, token=token, revision=revision) File "C:\Users\ningl\kohya_ss\venv\lib\site-packages\huggingface_hub\utils_validators.py", line 110, in _inner_fn validate_repo_id(arg_value) File "C:\Users\ningl\kohya_ss\venv\lib\site-packages\huggingface_hub\utils_validators.py", line 164, in validate_repo_id raise HFValidationError( huggingface_hub.utils.validators.HFValidationError: Repo id must use alphanumeric chars or '-', '', '.', '--' and '..' are forbidden, '-' and '.' cannot start or end the name, max length is 96: 'E:\stable-diffusion-webui\models\Stable-diffusion\v2-1_768-ema-pruned'. Traceback (most recent call last): File "C:\Users\ningl\miniconda3\envs\kohyass\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\ningl\miniconda3\envs\kohyass\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "C:\Users\ningl\kohya_ss\venv\Scripts\accelerate.exe__main__.py", line 7, in File "C:\Users\ningl\kohya_ss\venv\lib\site-packages\accelerate\commands\accelerate_cli.py", line 47, in main args.func(args) File "C:\Users\ningl\kohya_ss\venv\lib\site-packages\accelerate\commands\launch.py", line 1017, in launch_command simple_launcher(args) File "C:\Users\ningl\kohya_ss\venv\lib\site-packages\accelerate\commands\launch.py", line 637, in simple_launcher raise subprocess.CalledProcessError(returncode=process.returncode, cmd=cmd) subprocess.CalledProcessError: Command '['C:\Users\ningl\kohya_ss\venv\Scripts\python.exe', './train_network.py', '--bucket_no_upscale', '--bucket_reso_steps=64', '--cache_latents', '--cache_latents_to_disk', '--caption_extension=.txt', '--enable_bucket', '--min_bucket_reso=256', '--max_bucket_reso=768', '--learning_rate=0.0001', '--logging_dir=C:\Users\ningl\Desktop\trainingData\log', '--lr_scheduler=cosine_with_restarts', '--lr_scheduler_num_cycles=2', '--lr_warmup_steps=390', '--max_data_loader_n_workers=0', '--max_grad_norm=1', '--resolution=512,512', '--max_train_steps=3900', '--min_snr_gamma=5', '--mixed_precision=fp16', '--network_alpha=1', '--network_args', 'preset=full', 'conv_dim=1', 'conv_alpha=1', 'rank_dropout=0', 'module_dropout=0', 'factor=-1', 'use_cp=False', 'use_scalar=False', 'decompose_both=False', 'rank_dropout_scale=False', 'algo=lokr', 'train_norm=False', '--network_dim=8', '--network_dropout=0.15', '--network_module=lycoris.kohya', '--optimizer_type=AdamW8bit', '--output_dir=C:\Users\ningl\Desktop\trainingData\model', '--output_name=Shining_Geometry_style', '--pretrained_model_name_or_path=E:\stable-diffusion-webui\models\Stable-diffusion\v2-1_768-ema-pruned', '--save_every_n_epochs=1', '--save_model_as=safetensors', '--save_precision=fp16', '--scale_weight_norms=1', '--text_encoder_lr=0.0001', '--train_batch_size=1', '--training_comment=13 page pictures,1950 steps', '--train_data_dir=C:\Users\ningl\Desktop\trainingData\image', '--unet_lr=0.0001', '--v_parameterization', '--v2', '--xformers', '--sample_sampler=euler_a', '--sample_prompts=C:\Users\ningl\Desktop\trainingData\model\sample\prompt.txt', '--sample_every_n_steps=200']' returned non-zero exit status 1.

bmaltais commented 7 months ago

The error message you're encountering indicates a problem with specifying the model path for StableDiffusionPipeline.from_pretrained method in your train_network.py script. The from_pretrained method is typically used to load models from the Hugging Face Hub, and it expects a model identifier (repo name on Hugging Face) or a URL to a model hosted on Hugging Face Hub. However, it seems you are trying to load a model from a local file path (E:\stable-diffusion-webui\models\Stable-diffusion\v2-1_768-ema-pruned), which is causing the error because the method is interpreting it as a Hugging Face Hub repository identifier, which it is not.

This is most probably something kohya_ss will need to look into. You shold open an issue about this handling on his sd-scripts repo.

Make sure the model you are pointing to is actually a diffuser folder... did you intent to use a safetensors file? If so, make sure to add the file extension at the end.

Lecho303 commented 7 months ago

The error message you're encountering indicates a problem with specifying the model path for StableDiffusionPipeline.from_pretrained method in your train_network.py script. The from_pretrained method is typically used to load models from the Hugging Face Hub, and it expects a model identifier (repo name on Hugging Face) or a URL to a model hosted on Hugging Face Hub. However, it seems you are trying to load a model from a local file path (E:\stable-diffusion-webui\models\Stable-diffusion\v2-1_768-ema-pruned), which is causing the error because the method is interpreting it as a Hugging Face Hub repository identifier, which it is not.

This is most probably something kohya_ss will need to look into. You shold open an issue about this handling on his sd-scripts repo.

Make sure the model you are pointing to is actually a diffuser folder... did you intent to use a safetensors file? If so, make sure to add the file extension at the end.

the last issue was that i chose "custom",then show the error.but when i chose "v2-1",kohya could download that ckpt and started to training.but when i chose"v2",kohya also could download that ckpt,but could not start training,it showed the same error like this issue.

Lecho303 commented 7 months ago

The error message you're encountering indicates a problem with specifying the model path for StableDiffusionPipeline.from_pretrained method in your train_network.py script. The from_pretrained method is typically used to load models from the Hugging Face Hub, and it expects a model identifier (repo name on Hugging Face) or a URL to a model hosted on Hugging Face Hub. However, it seems you are trying to load a model from a local file path (E:\stable-diffusion-webui\models\Stable-diffusion\v2-1_768-ema-pruned), which is causing the error because the method is interpreting it as a Hugging Face Hub repository identifier, which it is not.

This is most probably something kohya_ss will need to look into. You shold open an issue about this handling on his sd-scripts repo.

Make sure the model you are pointing to is actually a diffuser folder... did you intent to use a safetensors file? If so, make sure to add the file extension at the end.

and thank u so much!!!!!!!! i could not image that u will reply my issue~~~