找回密码
 立即注册
查看: 1372|回复: 15

[StableDiffusion] kohya_ss又出现问题了

[复制链接]

4

主题

22

回帖

21

积分

新手上路

积分
21
发表于 2023-6-11 18:21:06 | 显示全部楼层 |阅读模式
今天kohya_ss莫明奇妙打不开,就全删了从新部署,过程也没问题,但是部署完打开后没办法训练,一训练就报错



然后我这是基于之前在git下载zip的部署的,去作者页面又重新下了个新的,部署中一堆错误,然后有时能打开有时打不开,搞了一天了

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×

4

主题

22

回帖

21

积分

新手上路

积分
21
 楼主| 发表于 2023-6-11 18:21:56 | 显示全部楼层
上图是旧版的,下图是新版的

2

主题

31

回帖

20

积分

新手上路

积分
20
发表于 2023-6-12 08:57:27 | 显示全部楼层
看起来好像是没装好。反复尝试,耐心等待咯。

点评

旧版的我找到问题了,新版的我图就是没装好报的错才问的。。。  详情 回复 发表于 2023-6-12 18:01

4

主题

22

回帖

21

积分

新手上路

积分
21
 楼主| 发表于 2023-6-12 18:01:31 | 显示全部楼层
Surran 发表于 2023-6-12 08:57
看起来好像是没装好。反复尝试,耐心等待咯。

旧版的我找到问题了,新版的我图就是没装好报的错才问的。。。

1

主题

13

回帖

26

积分

新手上路

积分
26
发表于 2023-6-13 10:37:39 | 显示全部楼层
看你的error信息,pip install步骤有问题,估计大概率是下包有网络问题,推荐挂全局代理或者改pip下包的地址为国内镜像站的地址,或者手动下载安装whl

点评

│ │ 1840 │ try: │ │ 1841 │ │ import xformers.ops  详情 回复 发表于 2023-6-13 19:35
CrossAttention.forward has been replaced to enable xformers. ╭─────────────────────────────── Traceback (most recent call last) ───────────────────  详情 回复 发表于 2023-6-13 19:34

4

主题

22

回帖

21

积分

新手上路

积分
21
 楼主| 发表于 2023-6-13 19:34:23 | 显示全部楼层
Walmart9035 发表于 2023-6-13 10:37
看你的error信息,pip install步骤有问题,估计大概率是下包有网络问题,推荐挂全局代理或者改pip下包的地 ...

CrossAttention.forward has been replaced to enable xformers.

╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ C:\stable-diffusion-webui\extensions\kohya_ss\library\train_util.py:1841 in                      │
│ replace_unet_cross_attn_to_xformers                                                              │
│                                                                                                  │
│   1838 def replace_unet_cross_attn_to_xformers():                                                │
│   1839 │   print("CrossAttention.forward has been replaced to enable xformers.")                 │
│   1840 │   try:                                                                                  │
│ ❱ 1841 │   │   import xformers.ops                                                               │
│   1842 │   except ImportError:                                                                   │
│   1843 │   │   raise ImportError("No xformers / xformersがインストールされていないようです")     │
│   1844                                                                                           │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
ModuleNotFoundError: No module named 'xformers'

During handling of the above exception, another exception occurred:

╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ C:\stable-diffusion-webui\extensions\kohya_ss\train_network.py:864 in <module>                   │
│                                                                                                  │
│   861 │   args = parser.parse_args()                                                             │
│   862 │   args = train_util.read_config_from_file(args, parser)                                  │
│   863 │                                                                                          │
│ ❱ 864 │   train(args)                                                                            │
│   865                                                                                            │
│                                                                                                  │
│ C:\stable-diffusion-webui\extensions\kohya_ss\train_network.py:163 in train                      │
│                                                                                                  │
│   160 │   text_encoder, vae, unet, _ = train_util.load_target_model(args, weight_dtype, accele   │
│   161 │                                                                                          │
│   162 │   # モデルに xformers とか memory efficient attention を組み込む                         │
│ ❱ 163 │   train_util.replace_unet_modules(unet, args.mem_eff_attn, args.xformers)                │
│   164 │                                                                                          │
│   165 │   # 差分追加学習のためにモデルを読み込む                                                 │
│   166 │   import sys                                                                             │
│                                                                                                  │
│ C:\stable-diffusion-webui\extensions\kohya_ss\library\train_util.py:1795 in replace_unet_modules │
│                                                                                                  │
│   1792 │   if mem_eff_attn:                                                                      │
│   1793 │   │   replace_unet_cross_attn_to_memory_efficient()                                     │
│   1794 │   elif xformers:                                                                        │
│ ❱ 1795 │   │   replace_unet_cross_attn_to_xformers()                                             │
│   1796                                                                                           │
│   1797                                                                                           │
│   1798 def replace_unet_cross_attn_to_memory_efficient():                                        │
│                                                                                                  │


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×

4

主题

22

回帖

21

积分

新手上路

积分
21
 楼主| 发表于 2023-6-13 19:35:42 | 显示全部楼层
Walmart9035 发表于 2023-6-13 10:37
看你的error信息,pip install步骤有问题,估计大概率是下包有网络问题,推荐挂全局代理或者改pip下包的地 ...

                                   │

│   1840 │   try:                                                                                  │

│   1841 │   │   import xformers.ops                                                               │

│   1842 │   except ImportError:                                                                   │

│ ❱ 1843 │   │   raise ImportError("No xformers / xformersがインストールされていないようです")     │

│   1844 │                                                                                         │

│   1845 │   def forward_xformers(self, x, context=None, mask=None):                               │

│   1846 │   │   h = self.heads                                                                    │

╰──────────────────────────────────────────────────────────────────────────────────────────────────╯

ImportError: No xformers / xformersがインストールされていないようです

╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮

│ C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\runpy.py:196 in               │

│ _run_module_as_main                                                                              │

│                                                                                                  │

│   193 │   main_globals = sys.modules["__main__"].__dict__                                        │

│   194 │   if alter_argv:                                                                         │

│   195 │   │   sys.argv[0] = mod_spec.origin                                                      │

│ ❱ 196 │   return _run_code(code, main_globals, None,                                             │

│   197 │   │   │   │   │    "__main__", mod_spec)                                                 │

│   198                                                                                            │

│   199 def run_module(mod_name, init_globals=None,                                                │

│                                                                                                  │

│ C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\runpy.py:86 in _run_code      │

│                                                                                                  │

│    83 │   │   │   │   │      __loader__ = loader,                                                │

│    84 │   │   │   │   │      __package__ = pkg_name,                                             │

│    85 │   │   │   │   │      __spec__ = mod_spec)                                                │

│ ❱  86 │   exec(code, run_globals)                                                                │

│    87 │   return run_globals                                                                     │

│    88                                                                                            │

│    89 def _run_module_code(code, init_globals=None,                                              │

│                                                                                                  │

│ in <module>:7                                                                                    │

│                                                                                                  │

│   4 from accelerate.commands.accelerate_cli import main                                          │

│   5 if __name__ == '__main__':                                                                   │

│   6 │   sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])                         │

│ ❱ 7 │   sys.exit(main())                                                                         │

│   8                                                                                              │

│                                                                                                  │

│ C:\stable-diffusion-webui\extensions\kohya_ss\venv\lib\site-packages\accelerate\commands\acceler │

│ ate_cli.py:45 in main                                                                            │

│                                                                                                  │

│   42 │   │   exit(1)                                                                             │

│   43 │                                                                                           │

│   44 │   # Run                                                                                   │

│ ❱ 45 │   args.func(args)                                                                         │

│   46                                                                                             │

│   47                                                                                             │

│   48 if __name__ == "__main__":                                                                  │

│                                                                                                  │

│ C:\stable-diffusion-webui\extensions\kohya_ss\venv\lib\site-packages\accelerate\commands\launch. │

│ py:1104 in launch_command                                                                        │

│                                                                                                  │

│   1101 │   elif defaults is not None and defaults.compute_environment == ComputeEnvironment.AMA  │

│   1102 │   │   sagemaker_launcher(defaults, args)                                                │

│   1103 │   else:                                                                                 │

│ ❱ 1104 │   │   simple_launcher(args)                                                             │

│   1105                                                                                           │

│   1106                                                                                           │

│   1107 def main():                                                                               │

│                                                                                                  │

│ C:\stable-diffusion-webui\extensions\kohya_ss\venv\lib\site-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.returncode, cmd=cmd)       │

│    568                                                                                           │

│    569                                                                                           │

│    570 def multi_gpu_launcher(args):                                                             │

╰──────────────────────────────────────────────────────────────────────────────────────────────────╯

CalledProcessError: Command '['C:\\stable-diffusion-webui\\extensions\\kohya_ss\\venv\\Scripts\\python.exe',

'train_network.py', '--enable_bucket',

'--pretrained_model_name_or_path=C:/stable-diffusion-webui/models/Stable-diffusion/GhostMix_V2.0.safetensors',

'--train_data_dir=C:/Users/Administrator/Desktop/girl', '--resolution=576,576',

'--output_dir=C:/Users/Administrator/Desktop/girl', '--logging_dir=C:/Users/Administrator/Desktop/girl',

'--network_alpha=64', '--save_model_as=safetensors', '--network_module=networks.lora', '--text_encoder_lr=5e-05',

'--unet_lr=0.0001', '--network_dim=32', '--output_name=last', '--lr_scheduler_num_cycles=10', '--learning_rate=0.0001',

'--lr_scheduler=cosine', '--lr_warmup_steps=110', '--train_batch_size=1', '--max_train_steps=1100',

'--save_every_n_epochs=1', '--mixed_precision=fp16', '--save_precision=fp16', '--seed=1234', '--cache_latents',

'--optimizer_type=AdamW8bit', '--max_data_loader_n_workers=0', '--bucket_reso_steps=64', '--xformers',

'--bucket_no_upscale', '--sample_sampler=euler_a',

'--sample_prompts=C:/Users/Administrator/Desktop/girl\\sample\\prompt.txt', '--sample_every_n_epochs=1']' returned

non-zero exit status 1.一次发不完分开发,点训练就报这个,这是少了啥呢

1

主题

13

回帖

26

积分

新手上路

积分
26
发表于 2023-6-14 09:24:41 | 显示全部楼层
ImportError: No xformers / xformers
从错误信息看,也许是这个,你装xformers了吗?
或者你把倒数第三行的'--xformers',这个从配置中删了试试

4

主题

22

回帖

21

积分

新手上路

积分
21
 楼主| 发表于 2023-6-14 12:07:50 来自手机 | 显示全部楼层
是的,但是安装是自动的,我不挂梯子的话这个就安装不了,安装报错打不开,挂梯子的话能打开但是运行报错…

5

主题

62

回帖

23

积分

新手上路

积分
23
发表于 2023-6-21 09:56:40 | 显示全部楼层
本帖最后由 hp_zerolan 于 2023-6-21 09:59 编辑

无论英文还是日文都提示的【xformers】没有安装,要么挂梯子,要么手动装,手动装有个好处,能看到具体的进度,Stable Diffusion自动装虽然方便,但是由于国内网络问题+没有进度条,失败了只能看提示语。

手动安装的部分:
1、首先确认你python版本没错;
2、xformers有许多依赖项,尝试安装以下依赖项(pip自己改成你虚拟环境下的地址,或者进入放pip的目录);
    pip install numpy scipy torch torchaudio transformers
3、清除pip缓存(pip自己改成你虚拟环境下的地址,或者进入放pip的目录);
    pip uninstall -y xformers
    pip cache purge
4、更新pip(pip自己改成你虚拟环境下的地址,或者进入放pip的目录);
    pip install --upgrade pip
5、安装xformers(pip自己改成你虚拟环境下的地址,或者进入放pip的目录);
    pip install xformers

点评

梯子我试过,可以解决,但是梯子不常有,我怕以后没了所以在折腾本地安装。。。  详情 回复 发表于 2023-6-22 23:23
我下载有xformers,而且一直是手动装的,因为自动装下载不了,老版本给的安装命令是pip install -U -I --no-deps https://github.com/C43H66N12O12S2/stable-diffusion-webui/releases/download/f/xformers-0.0.14.d  详情 回复 发表于 2023-6-22 22:56
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|openAI维基百科论坛 ( 京ICP备2021019752号-5|京公网安备 11010502051430号 )

GMT+8, 2024-9-8 08:36 , Processed in 0.160699 second(s), 52 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

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