Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

训练时出现的错误 #60

Closed
def2u1t opened this issue Apr 2, 2023 · 4 comments
Closed

训练时出现的错误 #60

def2u1t opened this issue Apr 2, 2023 · 4 comments

Comments

@def2u1t
Copy link

def2u1t commented Apr 2, 2023

[Dataset 0]
loading image sizes.
100%|████████████████████████████████████████████████████████████████████████████████| 76/76 [00:00<00:00, 4675.58it/s]
make buckets
number of images (including repeats) / 各bucketの画像枚数(繰り返し回数を含む)
bucket 0: resolution (384, 640), count: 54
bucket 1: resolution (448, 576), count: 12
bucket 2: resolution (512, 512), count: 342
bucket 3: resolution (640, 384), count: 48
mean ar error (without repeats): 0.022491709236204763
prepare accelerator
Using accelerator 0.15.0 or above.
loading model for process 0/1
load StableDiffusion checkpoint
C:\Users\default.DESKTOP-08UGQK7\Desktop\lora-scripts-main\venv\lib\site-packages\safetensors\torch.py:98: UserWarning: TypedStorage is deprecated. It will be removed in the future and UntypedStorage will be the only storage class. This should only matter to you if you are using storages directly.  To access UntypedStorage directly, use tensor.untyped_storage() instead of tensor.storage()
  with safe_open(filename, framework="pt", device=device) as f:
C:\Users\default.DESKTOP-08UGQK7\Desktop\lora-scripts-main\venv\lib\site-packages\torch\_utils.py:776: UserWarning: TypedStorage is deprecated. It will be removed in the future and UntypedStorage will be the only storage class. This should only matter to you if you are using storages directly.  To access UntypedStorage directly, use tensor.untyped_storage() instead of tensor.storage()
  return self.fget.__get__(instance, owner)()
C:\Users\default.DESKTOP-08UGQK7\Desktop\lora-scripts-main\venv\lib\site-packages\torch\storage.py:899: UserWarning: TypedStorage is deprecated. It will be removed in the future and UntypedStorage will be the only storage class. This should only matter to you if you are using storages directly.  To access UntypedStorage directly, use tensor.untyped_storage() instead of tensor.storage()
  storage = cls(wrap_storage=untyped_storage)
Traceback (most recent call last):
  File "C:\Users\default.DESKTOP-08UGQK7\Desktop\lora-scripts-main\sd-scripts\train_network.py", line 724, in <module>
    train(args)
  File "C:\Users\default.DESKTOP-08UGQK7\Desktop\lora-scripts-main\sd-scripts\train_network.py", line 135, in train
    text_encoder, vae, unet, _ = train_util.load_target_model(
  File "C:\Users\default.DESKTOP-08UGQK7\Desktop\lora-scripts-main\sd-scripts\library\train_util.py", line 2649, in load_target_model
    text_encoder, vae, unet = model_util.load_models_from_stable_diffusion_checkpoint(args.v2, name_or_path, device)
  File "C:\Users\default.DESKTOP-08UGQK7\Desktop\lora-scripts-main\sd-scripts\library\model_util.py", line 869, in load_models_from_stable_diffusion_checkpoint
    _, state_dict = load_checkpoint_with_text_encoder_conversion(ckpt_path, device)
  File "C:\Users\default.DESKTOP-08UGQK7\Desktop\lora-scripts-main\sd-scripts\library\model_util.py", line 844, in load_checkpoint_with_text_encoder_conversion
    state_dict = load_file(ckpt_path) # , device) # may causes error
  File "C:\Users\default.DESKTOP-08UGQK7\Desktop\lora-scripts-main\venv\lib\site-packages\safetensors\torch.py", line 100, in load_file
    result[k] = f.get_tensor(k)
RuntimeError: shape '[1280, 1280, 3, 3]' is invalid for input of size 3657939
Traceback (most recent call last):
  File "C:\Users\default.DESKTOP-08UGQK7\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\default.DESKTOP-08UGQK7\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\default.DESKTOP-08UGQK7\Desktop\lora-scripts-main\venv\Scripts\accelerate.exe\__main__.py", line 7, in <module>
  File "C:\Users\default.DESKTOP-08UGQK7\Desktop\lora-scripts-main\venv\lib\site-packages\accelerate\commands\accelerate_cli.py", line 45, in main
    args.func(args)
  File "C:\Users\default.DESKTOP-08UGQK7\Desktop\lora-scripts-main\venv\lib\site-packages\accelerate\commands\launch.py", line 1104, in launch_command
    simple_launcher(args)
  File "C:\Users\default.DESKTOP-08UGQK7\Desktop\lora-scripts-main\venv\lib\site-packages\accelerate\commands\launch.py", line 567, in simple_launcher
    raise subprocess.CalledProcessError(returncode=process.returncode, cmd=cmd)
subprocess.CalledProcessError: Command '['C:\\Users\\default.DESKTOP-08UGQK7\\Desktop\\lora-scripts-main\\venv\\Scripts\\python.exe', './sd-scripts/train_network.py', '--enable_bucket', '--pretrained_model_name_or_path=./sd-models/v1-5-pruned-emaonly.safetensors', '--train_data_dir=./train/nine-age', '--output_dir=./output', '--logging_dir=./logs', '--log_prefix=nine_ling', '--resolution=512,512', '--network_module=networks.lora', '--max_train_epochs=10', '--learning_rate=1e-4', '--unet_lr=1e-4', '--text_encoder_lr=1e-5', '--lr_scheduler=cosine_with_restarts', '--lr_warmup_steps=0', '--lr_scheduler_num_cycles=1', '--network_dim=32', '--network_alpha=32', '--output_name=nine_ling', '--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=safetensors', '--min_bucket_reso=256', '--max_bucket_reso=1024', '--keep_tokens=0']' returned non-zero exit status 1.
Train finished

以上是运行train.ps1时出现的报错,基础模型也换了,文件名照着大佬发的视频又检查了一遍还是不行,人已经傻了

@Georgebillion
Copy link
Contributor

确认素材分辨率,这玩意有点像你分辨率设置错误了

@4nth0ny1130
Copy link
Contributor

Check the base model hash, this error looks like a problem with your v1-5-pruned-emaonly.safetensors model

@def2u1t
Copy link
Author

def2u1t commented Apr 15, 2023 via email

@beetaa
Copy link

beetaa commented May 25, 2023

@yuanch1 你的底模如果是2.0/2.1版本,需要修改 is_v2_model = 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants