derrian-distro / LoRA_Easy_Training_Scripts

A UI made in Pyside6 to make training LoRA/LoCon and other LoRA type models in sd-scripts easy
GNU General Public License v3.0
998 stars 101 forks source link

TypeError: argument of type 'WindowsPath' is not iterable #214

Closed peteraiscape closed 3 weeks ago

peteraiscape commented 1 month ago

Hello all, I am trying to train my first own Lora with below settings: image

When I hit start training, I get the below message with an error:


loading image sizes.
100%|█████████████████████████████████████████████████████████████████████████████████| 35/35 [00:00<00:00, 340.56it/s]
make buckets
number of images (including repeats) / 各bucketの画像枚数(繰り返し回数を含む)
bucket 0: resolution (512, 512), count: 175
mean ar error (without repeats): 0.0
preparing accelerator
loading model for process 0/1
load StableDiffusion checkpoint: C:/Users/Lun4/stable-diffusion-webui/models/Stable-diffusion/juggernautXL_v9Rundiffusionphoto2.safetensors
building U-Net
loading U-Net from checkpoint
U-Net:  <All keys matched successfully>
building text encoders
loading text encoders from checkpoint
text encoder 1: <All keys matched successfully>
text encoder 2: <All keys matched successfully>
building VAE
loading VAE from checkpoint
VAE: <All keys matched successfully>
import network module: networks.lora
create LoRA network. base dim (rank): 32, alpha: 32.0
neuron dropout: p=None, rank dropout: p=None, module dropout: p=None
create LoRA for Text Encoder 1:
create LoRA for Text Encoder 2:
create LoRA for Text Encoder: 264 modules.
create LoRA for U-Net: 722 modules.
enable LoRA for text encoder
enable LoRA for U-Net
prepare optimizer, data loader etc.

===================================BUG REPORT===================================
Welcome to bitsandbytes. For bug reports, please submit your error trace to: https://github.com/TimDettmers/bitsandbytes/issues
For effortless bug reporting copy-paste your error into this form: https://docs.google.com/forms/d/e/1FAIpQLScPB8emS3Thkp66nvqwmjTEgxp8Y9ufuWTzFyr9kJ5AoI47dQ/viewform?usp=sf_link
================================================================================
CUDA SETUP: Loading binary C:\Users\Lun4\Desktop\Lora training\LoRA_Easy_Training_Scripts\sd_scripts\venv\lib\site-packages\bitsandbytes\libbitsandbytes_cudaall.dll...
Traceback (most recent call last):
  File "C:\Users\Lun4\Desktop\Lora training\LoRA_Easy_Training_Scripts\sd_scripts\sdxl_train_network.py", line 189, in <module>
    trainer.train(args)
  File "C:\Users\Lun4\Desktop\Lora training\LoRA_Easy_Training_Scripts\sd_scripts\train_network.py", line 348, in train
    optimizer_name, optimizer_args, optimizer = train_util.get_optimizer(args, trainable_params)
  File "C:\Users\Lun4\Desktop\Lora training\LoRA_Easy_Training_Scripts\sd_scripts\library\train_util.py", line 3480, in get_optimizer
    import bitsandbytes as bnb
  File "C:\Users\Lun4\Desktop\Lora training\LoRA_Easy_Training_Scripts\sd_scripts\venv\lib\site-packages\bitsandbytes\__init__.py", line 6, in <module>
    from .autograd._functions import (
  File "C:\Users\Lun4\Desktop\Lora training\LoRA_Easy_Training_Scripts\sd_scripts\venv\lib\site-packages\bitsandbytes\autograd\_functions.py", line 5, in <module>
    import bitsandbytes.functional as F
  File "C:\Users\Lun4\Desktop\Lora training\LoRA_Easy_Training_Scripts\sd_scripts\venv\lib\site-packages\bitsandbytes\functional.py", line 13, in <module>
    from .cextension import COMPILED_WITH_CUDA, lib
  File "C:\Users\Lun4\Desktop\Lora training\LoRA_Easy_Training_Scripts\sd_scripts\venv\lib\site-packages\bitsandbytes\cextension.py", line 41, in <module>
    lib = CUDALibrary_Singleton.get_instance().lib
  File "C:\Users\Lun4\Desktop\Lora training\LoRA_Easy_Training_Scripts\sd_scripts\venv\lib\site-packages\bitsandbytes\cextension.py", line 37, in get_instance
    cls._instance.initialize()
  File "C:\Users\Lun4\Desktop\Lora training\LoRA_Easy_Training_Scripts\sd_scripts\venv\lib\site-packages\bitsandbytes\cextension.py", line 31, in initialize
    self.lib = ct.cdll.LoadLibrary(binary_path)
  File "C:\Users\Lun4\AppData\Local\Programs\Python\Python310\lib\ctypes\__init__.py", line 452, in LoadLibrary
    return self._dlltype(name)
  File "C:\Users\Lun4\AppData\Local\Programs\Python\Python310\lib\ctypes\__init__.py", line 364, in __init__
    if '/' in name or '\\' in name:
TypeError: argument of type 'WindowsPath' is not iterable
Failed to train because of error:
Command '['C:\\Users\\Lun4\\Desktop\\Lora training\\LoRA_Easy_Training_Scripts\\sd_scripts\\venv\\Scripts\\python.exe', 'sd_scripts\\sdxl_train_network.py', '--config_file=runtime_store\\config.toml', '--dataset_config=runtime_store\\dataset.toml']' returned non-zero exit status 1.```

What could be the issue here?
Any response is highly appreciated, thank you!
Jelosus2 commented 1 month ago

Try the dev version and see if it solves the issue, is more up to date anyways. To clone it use git clone -b dev https://github.com/derrian-distro/LoRA_Easy_Training_Scripts.

Jelosus2 commented 1 month ago

Any update or should I close it?

Jelosus2 commented 3 weeks ago

I'll be closing the issue since it appears to be inactive, feel free to reopen it if you ever need to