bmaltais / kohya_ss

Apache License 2.0
9.54k stars 1.23k forks source link

Does anyone know how to fix this? #1114

Closed VIKOLAZERA closed 8 months ago

VIKOLAZERA commented 1 year ago

[Dataset 0] loading image sizes. 100%|████████████████████████████████████████████████████████████████████████████████| 10/10 [00:00<00:00, 1001.65it/s] make buckets min_bucket_reso and max_bucket_reso are ignored if bucket_no_upscale is set, because bucket reso is defined by image size automatically / bucket_no_upscaleが指定された場合は、bucketの解像度は画像サイズから自動計算されるため、min_bucket_resoとmax_bucket_resoは無視されます number of images (including repeats) / 各bucketの画像枚数(繰り返し回数を含む) bucket 0: resolution (512, 768), count: 1500 mean ar error (without repeats): 0.0 prepare accelerator D:\kohya_ss\venv\lib\site-packages\accelerate\accelerator.py:258: FutureWarning: logging_dir is deprecated and will be removed in version 0.18.0 of 🤗 Accelerate. Use project_dir instead. warnings.warn( Using accelerator 0.15.0 or above. loading model for process 0/1 load StableDiffusion checkpoint: D:/STABLE_DIFFUSION/stable-diffusion-webui/models/Stable-diffusion/majicmixRealistic_v6.safetensors loading u-net: loading vae: loading text encoder: CrossAttention.forward has been replaced to enable xformers. [Dataset 0] caching latents. 0%| | 0/10 [00:00<?, ?it/s] ╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮ │ D:\kohya_ss\train_db.py:486 in │ │ │ │ 483 │ args = parser.parse_args() │ │ 484 │ args = train_util.read_config_from_file(args, parser) │ │ 485 │ │ │ ❱ 486 │ train(args) │ │ 487 │ │ │ │ D:\kohya_ss\train_db.py:134 in train │ │ │ │ 131 │ │ vae.requiresgrad(False) │ │ 132 │ │ vae.eval() │ │ 133 │ │ with torch.no_grad(): │ │ ❱ 134 │ │ │ train_dataset_group.cache_latents(vae, args.vae_batch_size, args.cache_laten │ │ 135 │ │ vae.to("cpu") │ │ 136 │ │ if torch.cuda.is_available(): │ │ 137 │ │ │ torch.cuda.empty_cache() │ │ │ │ D:\kohya_ss\library\train_util.py:1422 in cache_latents │ │ │ │ 1419 │ def cache_latents(self, vae, vae_batch_size=1, cache_to_disk=False, is_main_process= │ │ 1420 │ │ for i, dataset in enumerate(self.datasets): │ │ 1421 │ │ │ print(f"[Dataset {i}]") │ │ ❱ 1422 │ │ │ dataset.cache_latents(vae, vae_batch_size, cache_to_disk, is_main_process) │ │ 1423 │ │ │ 1424 │ def is_latent_cacheable(self) -> bool: │ │ 1425 │ │ return all([dataset.is_latent_cacheable() for dataset in self.datasets]) │ │ │ │ D:\kohya_ss\library\train_util.py:814 in cache_latents │ │ │ │ 811 │ │ │ img_tensors = torch.stack(images, dim=0) │ │ 812 │ │ │ img_tensors = img_tensors.to(device=vae.device, dtype=vae.dtype) │ │ 813 │ │ │ │ │ ❱ 814 │ │ │ latents = vae.encode(img_tensors).latent_dist.sample().to("cpu") │ │ 815 │ │ │ │ │ 816 │ │ │ for info, latent in zip(batch, latents): │ │ 817 │ │ │ │ if cache_to_disk: │ │ │ │ D:\kohya_ss\venv\lib\site-packages\diffusers\models\vae.py:566 in encode │ │ │ │ 563 │ │ self.use_slicing = False │ │ 564 │ │ │ 565 │ def encode(self, x: torch.FloatTensor, return_dict: bool = True) -> AutoencoderKLOut │ │ ❱ 566 │ │ h = self.encoder(x) │ │ 567 │ │ moments = self.quant_conv(h) │ │ 568 │ │ posterior = DiagonalGaussianDistribution(moments) │ │ 569 │ │ │ │ D:\kohya_ss\venv\lib\site-packages\torch\nn\modules\module.py:1501 in _call_impl │ │ │ │ 1498 │ │ if not (self._backward_hooks or self._backward_pre_hooks or self._forward_hooks │ │ 1499 │ │ │ │ or _global_backward_pre_hooks or _global_backward_hooks │ │ 1500 │ │ │ │ or _global_forward_hooks or _global_forward_pre_hooks): │ │ ❱ 1501 │ │ │ return forward_call(*args, *kwargs) │ │ 1502 │ │ # Do not call functions when jit is used │ │ 1503 │ │ full_backward_hooks, non_full_backward_hooks = [], [] │ │ 1504 │ │ backward_pre_hooks = [] │ │ │ │ D:\kohya_ss\venv\lib\site-packages\diffusers\models\vae.py:130 in forward │ │ │ │ 127 │ │ │ 128 │ def forward(self, x): │ │ 129 │ │ sample = x │ │ ❱ 130 │ │ sample = self.conv_in(sample) │ │ 131 │ │ │ │ 132 │ │ # down │ │ 133 │ │ for down_block in self.down_blocks: │ │ │ │ D:\kohya_ss\venv\lib\site-packages\torch\nn\modules\module.py:1501 in _call_impl │ │ │ │ 1498 │ │ if not (self._backward_hooks or self._backward_pre_hooks or self._forward_hooks │ │ 1499 │ │ │ │ or _global_backward_pre_hooks or _global_backward_hooks │ │ 1500 │ │ │ │ or _global_forward_hooks or _global_forward_pre_hooks): │ │ ❱ 1501 │ │ │ return forward_call(args, **kwargs) │ │ 1502 │ │ # Do not call functions when jit is used │ │ 1503 │ │ full_backward_hooks, non_full_backward_hooks = [], [] │ │ 1504 │ │ backward_pre_hooks = [] │ │ │ │ D:\kohya_ss\venv\lib\site-packages\torch\nn\modules\conv.py:463 in forward │ │ │ │ 460 │ │ │ │ │ │ self.padding, self.dilation, self.groups) │ │ 461 │ │ │ 462 │ def forward(self, input: Tensor) -> Tensor: │ │ ❱ 463 │ │ return self._conv_forward(input, self.weight, self.bias) │ │ 464 │ │ 465 class Conv3d(_ConvNd): │ │ 466 │ doc = r"""Applies a 3D convolution over an input signal composed of several inpu │ │ │ │ D:\kohya_ss\venv\lib\site-packages\torch\nn\modules\conv.py:459 in _conv_forward │ │ │ │ 456 │ │ │ return F.conv2d(F.pad(input, self._reversed_padding_repeated_twice, mode=sel │ │ 457 │ │ │ │ │ │ │ weight, bias, self.stride, │ │ 458 │ │ │ │ │ │ │ _pair(0), self.dilation, self.groups) │ │ ❱ 459 │ │ return F.conv2d(input, weight, bias, self.stride, │ │ 460 │ │ │ │ │ │ self.padding, self.dilation, self.groups) │ │ 461 │ │ │ 462 │ def forward(self, input: Tensor) -> Tensor: │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ RuntimeError: "slow_conv2d_cpu" not implemented for 'Half' ╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮ │ C:\Users\Viktor\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\Viktor\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 :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 │ │ │ │ D:\kohya_ss\venv\lib\site-packages\accelerate\commands\accelerate_cli.py:45 in main │ │ │ │ 42 │ │ exit(1) │ │ 43 │ │ │ 44 │ # Run │ │ ❱ 45 │ args.func(args) │ │ 46 │ │ 47 │ │ 48 if name == "main": │ │ │ │ D:\kohya_ss\venv\lib\site-packages\accelerate\commands\launch.py:918 in launch_command │ │ │ │ 915 │ elif defaults is not None and defaults.compute_environment == ComputeEnvironment.AMA │ │ 916 │ │ sagemaker_launcher(defaults, args) │ │ 917 │ else: │ │ ❱ 918 │ │ simple_launcher(args) │ │ 919 │ │ 920 │ │ 921 def main(): │ │ │ │ D:\kohya_ss\venv\lib\site-packages\accelerate\commands\launch.py:580 in simple_launcher │ │ │ │ 577 │ process.wait() │ │ 578 │ if process.returncode != 0: │ │ 579 │ │ if not args.quiet: │ │ ❱ 580 │ │ │ raise subprocess.CalledProcessError(returncode=process.returncode, cmd=cmd) │ │ 581 │ │ else: │ │ 582 │ │ │ sys.exit(1) │ │ 583 │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ CalledProcessError: Command '['D:\kohya_ss\venv\Scripts\python.exe', 'train_db.py', '--enable_bucket', '--pretrained_model_name_or_path=D:/STABLE_DIFFUSION/stable-diffusion-webui/models/Stable-diffusion/majicmixRealistic_v6 .safetensors', '--train_data_dir=D:/AI_IMAGES/OF_IDOL_LORA/image', '--reg_data_dir=D:/regularization', '--resolution=768,768', '--output_dir=D:/AI_IMAGES/OF_IDOL_LORA/model', '--logging_dir=D:/AI_IMAGES/OF_IDOL_LORA/log', '--save_model_as=safetensors', '--output_name=idol', '--max_data_loader_n_workers=0', '--learning_rate=1e-05', '--lr_scheduler=constant', '--train_batch_size=2', '--max_train_steps=6000', '--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']' returned non-zero exit status 1.

EliasDerHai commented 1 year ago

same error