deepfacelab中文网

 找回密码
 立即注册(仅限QQ邮箱)
楼主: 抹茶味牛子

AI绘画之训练自己的Lora模型

  [复制链接]

5

主题

189

帖子

2334

积分

版主

Rank: 30Rank: 30Rank: 30Rank: 30Rank: 30Rank: 30Rank: 30Rank: 30

积分
2334

见习版主勋章优质版主勋章

 楼主| 发表于 2023-2-20 09:30:37 | 显示全部楼层
jinyuan37 发表于 2023-2-20 07:15
你是B站UP主么,这个有点麻烦,新版本全程图形界面操作简易。

那个需要安装anaconda,对小白来说也挺麻烦的
AI绘画讨论交流QQ群748167404
回复 支持 反对

使用道具 举报

0

主题

11

帖子

1309

积分

初级丹圣

Rank: 8Rank: 8

积分
1309
发表于 2023-2-20 10:09:45 | 显示全部楼层

好的,非常感谢
回复 支持 反对

使用道具 举报

1

主题

11

帖子

83

积分

高级丹童

Rank: 2

积分
83
发表于 2023-2-20 13:09:35 | 显示全部楼层

强制更新了,每次打开重新运行install-cn.ps1就出现这个环境失败
回复 支持 反对

使用道具 举报

5

主题

189

帖子

2334

积分

版主

Rank: 30Rank: 30Rank: 30Rank: 30Rank: 30Rank: 30Rank: 30Rank: 30

积分
2334

见习版主勋章优质版主勋章

 楼主| 发表于 2023-2-20 13:20:49 | 显示全部楼层
avxwang 发表于 2023-2-20 13:09
强制更新了,每次打开重新运行install-cn.ps1就出现这个环境失败

加群贴图吧
AI绘画讨论交流QQ群748167404
回复 支持 反对

使用道具 举报

4

主题

28

帖子

158

积分

高级丹童

Rank: 2

积分
158
发表于 2023-2-20 17:04:38 | 显示全部楼层

prepare tokenizer
update token length: 225
Use DreamBooth method.
prepare train images.
found directory 3_sucai contains 118 image files
354 train images with repeating.
loading image sizes.
100%|██████████████████████████████████████████████████████████████████████████████| 118/118 [00:00<00:00, 4286.31it/s]
make buckets
number of images (including repeats) / 各bucketの画像枚数(繰り返し回数を含む)
bucket 0: resolution (512, 640), count: 354
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 "F:\lora-scripts\venv\lib\site-packages\diffusers\configuration_utils.py", line 326, in load_config
    config_file = hf_hub_download(
  File "F:\lora-scripts\venv\lib\site-packages\huggingface_hub\utils\_validators.py", line 114, in _inner_fn
    validate_repo_id(arg_value)
  File "F:\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.skpt'. Use `repo_type` argument if needed.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "F:\lora-scripts\sd-scripts\train_network.py", line 548, in <module>
    train(args)
  File "F:\lora-scripts\sd-scripts\train_network.py", line 156, in train
    text_encoder, vae, unet, _ = train_util.load_target_model(args, weight_dtype)
  File "F:\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 "F:\lora-scripts\venv\lib\site-packages\diffusers\pipeline_utils.py", line 454, in from_pretrained
    config_dict = cls.load_config(
  File "F:\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.skpt 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\Administrator\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\Administrator\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "F:\lora-scripts\venv\Scripts\accelerate.exe\__main__.py", line 7, in <module>
  File "F:\lora-scripts\venv\lib\site-packages\accelerate\commands\accelerate_cli.py", line 45, in main
    args.func(args)
  File "F:\lora-scripts\venv\lib\site-packages\accelerate\commands\launch.py", line 1104, in launch_command
    simple_launcher(args)
  File "F:\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 '['F:\\lora-scripts\\venv\\Scripts\\python.exe', './sd-scripts/train_network.py', '--enable_bucket', '--pretrained_model_name_or_path=./sd-models/model.skpt', '--train_data_dir=./train/sucai/', '--output_dir=./output', '--logging_dir=./logs', '--resolution=512,640', '--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', '--network_dim=32', '--network_alpha=32', '--output_name=gaoye', '--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', '--xformers', '--shuffle_caption', '--use_8bit_adam']' returned non-zero exit status 1.
Train finished
回复 支持 反对

使用道具 举报

4

主题

28

帖子

158

积分

高级丹童

Rank: 2

积分
158
发表于 2023-2-20 17:05:39 | 显示全部楼层

train.ps1后,请问版主这是什么问题
回复 支持 反对

使用道具 举报

20

主题

153

帖子

4737

积分

高级丹圣

Rank: 13Rank: 13Rank: 13Rank: 13

积分
4737
发表于 2023-2-20 17:32:10 | 显示全部楼层
这个一体包 还挺多bug  用着用这就会不行 有的时候重新覆盖文件可以有的时候 不行 重新安装都不行  不知道是就我还是 不少人
回复 支持 反对

使用道具 举报

5

主题

189

帖子

2334

积分

版主

Rank: 30Rank: 30Rank: 30Rank: 30Rank: 30Rank: 30Rank: 30Rank: 30

积分
2334

见习版主勋章优质版主勋章

 楼主| 发表于 2023-2-20 18:14:01 | 显示全部楼层
831 发表于 2023-2-20 17:04
prepare tokenizer
update token length: 225
Use DreamBooth method.

大哥你这./sd-models/model.skpt,命名错了,是ckpt
AI绘画讨论交流QQ群748167404
回复 支持 反对

使用道具 举报

2

主题

27

帖子

887

积分

高级丹师

Rank: 5Rank: 5

积分
887

万事如意节日勋章

发表于 2023-2-21 01:53:56 | 显示全部楼层
https://github.com/bmaltais/kohya_ss#optional-cudnn-86
这个版本是不是一样???
回复 支持 反对

使用道具 举报

4

主题

28

帖子

158

积分

高级丹童

Rank: 2

积分
158
发表于 2023-2-21 08:10:47 | 显示全部楼层
抹茶味牛子 发表于 2023-2-20 18:14
大哥你这./sd-models/model.skpt,命名错了,是ckpt

然后就填入配置文件

$pretrained_model = "./sd-models/model.skpt"

$train_data_dir指的就是我们刚才创建的存放素材的位置,我这里就填入


你的教程里是这样写的,我修改成./sd-models/model.ckpt还是不行
回复 支持 反对

使用道具 举报

QQ|Archiver|手机版|deepfacelab中文网 |网站地图

GMT+8, 2024-5-14 07:11 , Processed in 0.082548 second(s), 8 queries , Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表