LyCORIS icon indicating copy to clipboard operation
LyCORIS copied to clipboard

diag_oft/Boft [rank0]: RuntimeError: dictionary changed size during iteration

Open GenocidalStudios opened this issue 1 year ago • 1 comments

lycoris-lora==3.0.1.dev1

Got a runtime error when using either Diag_OFT or BOFT. [rank0]: RuntimeError: dictionary changed size during iteration From

2024-07-27 14:41:44|[LyCORIS]-WARNING: constrain is deprecated. Please use constraint instead.
[rank0]: Traceback (most recent call last):
[rank0]:   File ".../kohya_ss/sd-scripts/sdxl_train_network.py", line 185, in <module>
[rank0]:     trainer.train(args)
[rank0]:   File ".../kohya_ss/sd-scripts/train_network.py", line 299, in train
[rank0]:     network = network_module.create_network(
[rank0]:   File ".../kohya_ss/venv/lib64/python3.10/site-packages/lycoris/kohya.py", line 31, in create_network
[rank0]:     for key, value in kwargs.items():
[rank0]: RuntimeError: dictionary changed size during iteration

As a quick fix, I changed: for key, value in kwargs.items(): to for key, value in list(kwargs.items()): on line 31 of kohya.py

GenocidalStudios avatar Jul 27 '24 18:07 GenocidalStudios

investigating thx for info

KohakuBlueleaf avatar Jul 31 '24 16:07 KohakuBlueleaf

Fixed in https://github.com/KohakuBlueleaf/LyCORIS/commit/ff5ccf32f311b26b950ea546c2db038f90e9cea0 Will be pushed to main/pypi in next version

KohakuBlueleaf avatar Sep 03 '24 05:09 KohakuBlueleaf