|
|
|
epoch 1/10 |
|
Traceback (most recent call last): |
|
File "/workspace/kohya_ss/./sdxl_train_network.py", line 176, in <module> |
|
trainer.train(args) |
|
File "/workspace/kohya_ss/train_network.py", line 773, in train |
|
noise_pred = self.call_unet( |
|
File "/workspace/kohya_ss/./sdxl_train_network.py", line 156, in call_unet |
|
noise_pred = unet(noisy_latents, timesteps, text_embedding, vector_embedding) |
|
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1501, in _call_impl |
|
return forward_call(*args, **kwargs) |
|
File "/usr/local/lib/python3.10/dist-packages/accelerate/utils/operations.py", line 521, in forward |
|
return model_forward(*args, **kwargs) |
|
File "/usr/local/lib/python3.10/dist-packages/accelerate/utils/operations.py", line 509, in __call__ |
|
return convert_to_fp32(self.model_forward(*args, **kwargs)) |
|
File "/usr/local/lib/python3.10/dist-packages/torch/amp/autocast_mode.py", line 14, in decorate_autocast |
|
return func(*args, **kwargs) |
|
File "/workspace/kohya_ss/library/sdxl_original_unet.py", line 1088, in forward |
|
h = call_module(module, h, emb, context) |
|
File "/workspace/kohya_ss/library/sdxl_original_unet.py", line 1071, in call_module |
|
x = layer(x, emb) |
|
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1501, in _call_impl |
|
return forward_call(*args, **kwargs) |
|
File "/workspace/kohya_ss/library/sdxl_original_unet.py", line 328, in forward |
|
x = self.forward_body(x, emb) |
|
File "/workspace/kohya_ss/library/sdxl_original_unet.py", line 309, in forward_body |
|
h = self.in_layers(x) |
|
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1501, in _call_impl |
|
return forward_call(*args, **kwargs) |
|
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/container.py", line 217, in forward |
|
input = module(input) |
|
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1501, in _call_impl |
|
return forward_call(*args, **kwargs) |
|
File "/workspace/kohya_ss/library/sdxl_original_unet.py", line 272, in forward |
|
return super().forward(x) |
|
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/normalization.py", line 273, in forward |
|
return F.group_norm( |
|
File "/usr/local/lib/python3.10/dist-packages/torch/nn/functional.py", line 2530, in group_norm |
|
return torch.group_norm(input, num_groups, weight, bias, eps, torch.backends.cudnn.enabled) |
|
torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 40.00 MiB (GPU 0; 19.71 GiB total capacity; 17.84 GiB already allocated; 6.62 MiB free; 18.10 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF |
|
[31m╭─────────────────────────────── [39m[1mTraceback (most recent call last)[31m[22m ────────────────────────────────╮ |
|
[31m│[39m /workspace/kohya_ss/./[1msdxl_train_network.py[22m:[94m176[39m in [92m<module>[39m [31m│ |
|
[31m│[39m [31m│ |
|
[31m│[39m 173 │ args = train_util.read_config_from_file(args, parser) [31m│ |
|
[31m│[39m 174 │ [31m│ |
|
[31m│[39m 175 │ trainer = SdxlNetworkTrainer() [31m│ |
|
[31m│[39m [31m❱ [39m176 │ trainer.train(args) [31m│ |
|
[31m│[39m 177 [31m│ |
|
[31m│[39m [31m│ |
|
[31m│[39m /workspace/kohya_ss/[1mtrain_network.py[22m:[94m773[39m in [92mtrain[39m [31m│ |
|
[31m│[39m [31m│ |
|
[31m│[39m 770 │ │ │ │ │ [31m│ |
|
[31m│[39m 771 │ │ │ │ │ # Predict the noise residual [31m│ |
|
[31m│[39m 772 │ │ │ │ │ [94mwith[39m accelerator.autocast(): [31m│ |
|
[31m│[39m [31m❱ [39m773 │ │ │ │ │ │ noise_pred = [96mself[39m.call_unet( [31m│ |
|
[31m│[39m 774 │ │ │ │ │ │ │ args, accelerator, unet, noisy_latents, timesteps, text_enco [31m│ |
|
[31m│[39m 775 │ │ │ │ │ │ ) [31m│ |
|
[31m│[39m 776 [31m│ |
|
[31m│[39m [31m│ |
|
[31m│[39m /workspace/kohya_ss/./[1msdxl_train_network.py[22m:[94m156[39m in [92mcall_unet[39m [31m│ |
|
[31m│[39m [31m│ |
|
[31m│[39m 153 │ │ vector_embedding = torch.cat([pool2, embs], dim=[94m1[39m).to(weight_dtype) [31m│ |
|
[31m│[39m 154 │ │ text_embedding = torch.cat([encoder_hidden_states1, encoder_hidden_states2], dim [31m│ |
|
[31m│[39m 155 │ │ [31m│ |
|
[31m│[39m [31m❱ [39m156 │ │ noise_pred = unet(noisy_latents, timesteps, text_embedding, vector_embedding) [31m│ |
|
[31m│[39m 157 │ │ [94mreturn[39m noise_pred [31m│ |
|
[31m│[39m 158 │ [31m│ |
|
[31m│[39m 159 │ [94mdef[39m [92msample_images[39m([96mself[39m, accelerator, args, epoch, global_step, device, vae, tokenize [31m│ |
|
[31m│[39m [31m│ |
|
[31m│[39m /usr/local/lib/python3.10/dist-packages/torch/nn/modules/[1mmodule.py[22m:[94m1501[39m in [92m_call_impl[39m [31m│ |
|
[31m│[39m [31m│ |
|
[31m│[39m 1498 │ │ [94mif[39m [95mnot[39m ([96mself[39m._backward_hooks [95mor[39m [96mself[39m._backward_pre_hooks [95mor[39m [96mself[39m._forward_hooks [31m│ |
|
[31m│[39m 1499 │ │ │ │ [95mor[39m _global_backward_pre_hooks [95mor[39m _global_backward_hooks [31m│ |
|
[31m│[39m 1500 │ │ │ │ [95mor[39m _global_forward_hooks [95mor[39m _global_forward_pre_hooks): [31m│ |
|
[31m│[39m [31m❱ [39m1501 │ │ │ [94mreturn[39m forward_call(*args, **kwargs) [31m│ |
|
[31m│[39m 1502 │ │ # Do not call functions when jit is used [31m│ |
|
[31m│[39m 1503 │ │ full_backward_hooks, non_full_backward_hooks = [], [] [31m│ |
|
[31m│[39m 1504 │ │ backward_pre_hooks = [] [31m│ |
|
[31m│[39m [31m│ |
|
[31m│[39m /usr/local/lib/python3.10/dist-packages/accelerate/utils/[1moperations.py[22m:[94m521[39m in [92mforward[39m [31m│ |
|
[31m│[39m [31m│ |
|
[31m│[39m 518 │ model_forward = ConvertOutputsToFp32(model_forward) [31m│ |
|
[31m│[39m 519 │ [31m│ |
|
[31m│[39m 520 │ [94mdef[39m [92mforward[39m(*args, **kwargs): [31m│ |
|
[31m│[39m [31m❱ [39m521 │ │ [94mreturn[39m model_forward(*args, **kwargs) [31m│ |
|
[31m│[39m 522 │ [31m│ |
|
[31m│[39m 523 │ # To act like a decorator so that it can be popped when doing `extract_model_from_pa [31m│ |
|
[31m│[39m 524 │ forward.__wrapped__ = model_forward [31m│ |
|
[31m│[39m [31m│ |
|
[31m│[39m /usr/local/lib/python3.10/dist-packages/accelerate/utils/[1moperations.py[22m:[94m509[39m in [92m__call__[39m [31m│ |
|
[31m│[39m [31m│ |
|
[31m│[39m 506 │ │ update_wrapper([96mself[39m, model_forward) [31m│ |
|
[31m│[39m 507 │ [31m│ |
|
[31m│[39m 508 │ [94mdef[39m [92m__call__[39m([96mself[39m, *args, **kwargs): [31m│ |
|
[31m│[39m [31m❱ [39m509 │ │ [94mreturn[39m convert_to_fp32([96mself[39m.model_forward(*args, **kwargs)) [31m│ |
|
[31m│[39m 510 │ [31m│ |
|
[31m│[39m 511 │ [94mdef[39m [92m__getstate__[39m([96mself[39m): [31m│ |
|
[31m│[39m 512 │ │ [94mraise[39m pickle.PicklingError( [31m│ |
|
[31m│[39m [31m│ |
|
[31m│[39m /usr/local/lib/python3.10/dist-packages/torch/amp/[1mautocast_mode.py[22m:[94m14[39m in [92mdecorate_autocast[39m [31m│ |
|
[31m│[39m [31m│ |
|
[31m│[39m 11 │ [1m@functools[22m.wraps(func) [31m│ |
|
[31m│[39m 12 │ [94mdef[39m [92mdecorate_autocast[39m(*args, **kwargs): [31m│ |
|
[31m│[39m 13 │ │ [94mwith[39m autocast_instance: [31m│ |
|
[31m│[39m [31m❱ [39m 14 │ │ │ [94mreturn[39m func(*args, **kwargs) [31m│ |
|
[31m│[39m 15 │ decorate_autocast.__script_unsupported = [33m'@autocast() decorator is not supported in [39m [31m│ |
|
[31m│[39m 16 │ [94mreturn[39m decorate_autocast [31m│ |
|
[31m│[39m 17 [31m│ |
|
[31m│[39m [31m│ |
|
[31m│[39m /workspace/kohya_ss/library/[1msdxl_original_unet.py[22m:[94m1088[39m in [92mforward[39m [31m│ |
|
[31m│[39m [31m│ |
|
[31m│[39m 1085 │ │ [31m│ |
|
[31m│[39m 1086 │ │ [94mfor[39m module [95min[39m [96mself[39m.output_blocks: [31m│ |
|
[31m│[39m 1087 │ │ │ h = torch.cat([h, hs.pop()], dim=[94m1[39m) [31m│ |
|
[31m│[39m [31m❱ [39m1088 │ │ │ h = call_module(module, h, emb, context) [31m│ |
|
[31m│[39m 1089 │ │ [31m│ |
|
[31m│[39m 1090 │ │ h = h.type(x.dtype) [31m│ |
|
[31m│[39m 1091 │ │ h = call_module([96mself[39m.out, h, emb, context) [31m│ |
|
[31m│[39m [31m│ |
|
[31m│[39m /workspace/kohya_ss/library/[1msdxl_original_unet.py[22m:[94m1071[39m in [92mcall_module[39m [31m│ |
|
[31m│[39m [31m│ |
|
[31m│[39m 1068 │ │ │ [94mfor[39m layer [95min[39m module: [31m│ |
|
[31m│[39m 1069 │ │ │ │ # print(layer.__class__.__name__, x.dtype, emb.dtype, context.dtype if c [31m│ |
|
[31m│[39m 1070 │ │ │ │ [94mif[39m [96misinstance[39m(layer, ResnetBlock2D): [31m│ |
|
[31m│[39m [31m❱ [39m1071 │ │ │ │ │ x = layer(x, emb) [31m│ |
|
[31m│[39m 1072 │ │ │ │ [94melif[39m [96misinstance[39m(layer, Transformer2DModel): [31m│ |
|
[31m│[39m 1073 │ │ │ │ │ x = layer(x, context) [31m│ |
|
[31m│[39m 1074 │ │ │ │ [94melse[39m: [31m│ |
|
[31m│[39m [31m│ |
|
[31m│[39m /usr/local/lib/python3.10/dist-packages/torch/nn/modules/[1mmodule.py[22m:[94m1501[39m in [92m_call_impl[39m [31m│ |
|
[31m│[39m [31m│ |
|
[31m│[39m 1498 │ │ [94mif[39m [95mnot[39m ([96mself[39m._backward_hooks [95mor[39m [96mself[39m._backward_pre_hooks [95mor[39m [96mself[39m._forward_hooks [31m│ |
|
[31m│[39m 1499 │ │ │ │ [95mor[39m _global_backward_pre_hooks [95mor[39m _global_backward_hooks [31m│ |
|
[31m│[39m 1500 │ │ │ │ [95mor[39m _global_forward_hooks [95mor[39m _global_forward_pre_hooks): [31m│ |
|
[31m│[39m [31m❱ [39m1501 │ │ │ [94mreturn[39m forward_call(*args, **kwargs) [31m│ |
|
[31m│[39m 1502 │ │ # Do not call functions when jit is used [31m│ |
|
[31m│[39m 1503 │ │ full_backward_hooks, non_full_backward_hooks = [], [] [31m│ |
|
[31m│[39m 1504 │ │ backward_pre_hooks = [] [31m│ |
|
[31m│[39m [31m│ |
|
[31m│[39m /workspace/kohya_ss/library/[1msdxl_original_unet.py[22m:[94m328[39m in [92mforward[39m [31m│ |
|
[31m│[39m [31m│ |
|
[31m│[39m 325 │ │ │ [31m│ |
|
[31m│[39m 326 │ │ │ x = torch.utils.checkpoint.checkpoint(create_custom_forward([96mself[39m.forward_bod [31m│ |
|
[31m│[39m 327 │ │ [94melse[39m: [31m│ |
|
[31m│[39m [31m❱ [39m 328 │ │ │ x = [96mself[39m.forward_body(x, emb) [31m│ |
|
[31m│[39m 329 │ │ [31m│ |
|
[31m│[39m 330 │ │ [94mreturn[39m x [31m│ |
|
[31m│[39m 331 [31m│ |
|
[31m│[39m [31m│ |
|
[31m│[39m /workspace/kohya_ss/library/[1msdxl_original_unet.py[22m:[94m309[39m in [92mforward_body[39m [31m│ |
|
[31m│[39m [31m│ |
|
[31m│[39m 306 │ │ [96mself[39m.gradient_checkpointing = [94mFalse[39m [31m│ |
|
[31m│[39m 307 │ [31m│ |
|
[31m│[39m 308 │ [94mdef[39m [92mforward_body[39m([96mself[39m, x, emb): [31m│ |
|
[31m│[39m [31m❱ [39m 309 │ │ h = [96mself[39m.in_layers(x) [31m│ |
|
[31m│[39m 310 │ │ emb_out = [96mself[39m.emb_layers(emb).type(h.dtype) [31m│ |
|
[31m│[39m 311 │ │ h = h + emb_out[:, :, [94mNone[39m, [94mNone[39m] [31m│ |
|
[31m│[39m 312 │ │ h = [96mself[39m.out_layers(h) [31m│ |
|
[31m│[39m [31m│ |
|
[31m│[39m /usr/local/lib/python3.10/dist-packages/torch/nn/modules/[1mmodule.py[22m:[94m1501[39m in [92m_call_impl[39m [31m│ |
|
[31m│[39m [31m│ |
|
[31m│[39m 1498 │ │ [94mif[39m [95mnot[39m ([96mself[39m._backward_hooks [95mor[39m [96mself[39m._backward_pre_hooks [95mor[39m [96mself[39m._forward_hooks [31m│ |
|
[31m│[39m 1499 │ │ │ │ [95mor[39m _global_backward_pre_hooks [95mor[39m _global_backward_hooks [31m│ |
|
[31m│[39m 1500 │ │ │ │ [95mor[39m _global_forward_hooks [95mor[39m _global_forward_pre_hooks): [31m│ |
|
[31m│[39m [31m❱ [39m1501 │ │ │ [94mreturn[39m forward_call(*args, **kwargs) [31m│ |
|
[31m│[39m 1502 │ │ # Do not call functions when jit is used [31m│ |
|
[31m│[39m 1503 │ │ full_backward_hooks, non_full_backward_hooks = [], [] [31m│ |
|
[31m│[39m 1504 │ │ backward_pre_hooks = [] [31m│ |
|
[31m│[39m [31m│ |
|
[31m│[39m /usr/local/lib/python3.10/dist-packages/torch/nn/modules/[1mcontainer.py[22m:[94m217[39m in [92mforward[39m [31m│ |
|
[31m│[39m [31m│ |
|
[31m│[39m 214 │ # with Any as TorchScript expects a more precise type [31m│ |
|
[31m│[39m 215 │ [94mdef[39m [92mforward[39m([96mself[39m, [96minput[39m): [31m│ |
|
[31m│[39m 216 │ │ [94mfor[39m module [95min[39m [96mself[39m: [31m│ |
|
[31m│[39m [31m❱ [39m217 │ │ │ [96minput[39m = module([96minput[39m) [31m│ |
|
[31m│[39m 218 │ │ [94mreturn[39m [96minput[39m [31m│ |
|
[31m│[39m 219 │ [31m│ |
|
[31m│[39m 220 │ [94mdef[39m [92mappend[39m([96mself[39m, module: Module) -> [33m'Sequential'[39m: [31m│ |
|
[31m│[39m [31m│ |
|
[31m│[39m /usr/local/lib/python3.10/dist-packages/torch/nn/modules/[1mmodule.py[22m:[94m1501[39m in [92m_call_impl[39m [31m│ |
|
[31m│[39m [31m│ |
|
[31m│[39m 1498 │ │ [94mif[39m [95mnot[39m ([96mself[39m._backward_hooks [95mor[39m [96mself[39m._backward_pre_hooks [95mor[39m [96mself[39m._forward_hooks [31m│ |
|
[31m│[39m 1499 │ │ │ │ [95mor[39m _global_backward_pre_hooks [95mor[39m _global_backward_hooks [31m│ |
|
[31m│[39m 1500 │ │ │ │ [95mor[39m _global_forward_hooks [95mor[39m _global_forward_pre_hooks): [31m│ |
|
[31m│[39m [31m❱ [39m1501 │ │ │ [94mreturn[39m forward_call(*args, **kwargs) [31m│ |
|
[31m│[39m 1502 │ │ # Do not call functions when jit is used [31m│ |
|
[31m│[39m 1503 │ │ full_backward_hooks, non_full_backward_hooks = [], [] [31m│ |
|
[31m│[39m 1504 │ │ backward_pre_hooks = [] [31m│ |
|
[31m│[39m [31m│ |
|
[31m│[39m /workspace/kohya_ss/library/[1msdxl_original_unet.py[22m:[94m272[39m in [92mforward[39m [31m│ |
|
[31m│[39m [31m│ |
|
[31m│[39m 269 [94mclass[39m [4mGroupNorm32[24m(nn.GroupNorm): [31m│ |
|
[31m│[39m 270 │ [94mdef[39m [92mforward[39m([96mself[39m, x): [31m│ |
|
[31m│[39m 271 │ │ [94mif[39m [96mself[39m.weight.dtype != torch.float32: [31m│ |
|
[31m│[39m [31m❱ [39m 272 │ │ │ [94mreturn[39m [96msuper[39m().forward(x) [31m│ |
|
[31m│[39m 273 │ │ [94mreturn[39m [96msuper[39m().forward(x.float()).type(x.dtype) [31m│ |
|
[31m│[39m 274 [31m│ |
|
[31m│[39m 275 [31m│ |
|
[31m│[39m [31m│ |
|
[31m│[39m /usr/local/lib/python3.10/dist-packages/torch/nn/modules/[1mnormalization.py[22m:[94m273[39m in [92mforward[39m [31m│ |
|
[31m│[39m [31m│ |
|
[31m│[39m 270 │ │ │ init.zeros_([96mself[39m.bias) [31m│ |
|
[31m│[39m 271 │ [31m│ |
|
[31m│[39m 272 │ [94mdef[39m [92mforward[39m([96mself[39m, [96minput[39m: Tensor) -> Tensor: [31m│ |
|
[31m│[39m [31m❱ [39m273 │ │ [94mreturn[39m F.group_norm( [31m│ |
|
[31m│[39m 274 │ │ │ [96minput[39m, [96mself[39m.num_groups, [96mself[39m.weight, [96mself[39m.bias, [96mself[39m.eps) [31m│ |
|
[31m│[39m 275 │ [31m│ |
|
[31m│[39m 276 │ [94mdef[39m [92mextra_repr[39m([96mself[39m) -> [96mstr[39m: [31m│ |
|
[31m│[39m [31m│ |
|
[31m│[39m /usr/local/lib/python3.10/dist-packages/torch/nn/[1mfunctional.py[22m:[94m2530[39m in [92mgroup_norm[39m [31m│ |
|
[31m│[39m [31m│ |
|
[31m│[39m 2527 │ [94mif[39m [96minput[39m.dim() < [94m2[39m: [31m│ |
|
[31m│[39m 2528 │ │ [94mraise[39m [96mRuntimeError[39m([33mf"Expected at least 2 dimensions for input tensor but receive[39m [31m│ |
|
[31m│[39m 2529 │ _verify_batch_size([[96minput[39m.size([94m0[39m) * [96minput[39m.size([94m1[39m) |
|
[31m│[39m [31m❱ [39m2530 │ [94mreturn[39m torch.group_norm([96minput[39m, num_groups, weight, bias, eps, torch.backends.cudnn.e [31m│ |
|
[31m│[39m 2531 [31m│ |
|
[31m│[39m 2532 [31m│ |
|
[31m│[39m 2533 [94mdef[39m [92mlocal_response_norm[39m([96minput[39m: Tensor, size: [96mint[39m, alpha: [96mfloat[39m = [94m1e-4[39m, beta: [96mfloat[39m = [94m0.7[39m [31m│ |
|
[31m╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ |
|
[1mOutOfMemoryError: [22mCUDA out of memory. Tried to allocate [1m40.00[22m MiB [1m([22mGPU [1m0[22m; [1m19.71[22m GiB total capacity; [1m17.84[22m GiB already allocated; [1m6.62[22m MiB free; [1m18.10[22m GiB reserved in total by PyTorch[1m)[22m If reserved |
|
memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF |