-
Notifications
You must be signed in to change notification settings - Fork 877
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resizing of extracted lora giving error IndexError: index 320 is out of bounds for dimension 0 with size 320
#325
Comments
Oops. This is a mistake on my part. It is because none of the dims in one or more of the layer can satisfy the "sv_ratio = 20" requirement so the index goes out of bounds since the dimension of that layer is only 320. It looks like I had meant to wrap a min function at line 135 but applied it at line 148 instead. As a quick fix, it should run if you insert the following line below line 135 in
the updated if statement block should look like this:
I'll also get together a PR to fix this. As a side note, I tested on the same models that you did to confirm the error and noticed that the output file sizes are still quite large. I'd recommend trying a lower sv_ratio (5-15 range) or capping the max dim to see if you can reduce the size more aggressively. If you want a numerical comparison on how "well" it was able to replicate the original, you can add the flag For example at sv_ratio = 20, the result is 97.7%, and sv_ratio = 10, the result is 93.7% Of course, visual test at the end is needed to see if the result is satisfactory. I've also noticed though that extracted LoRA tend to require larger sizes than resizing natively trained LoRA so in the end it may not be possible to retain the level of information you want without having a large file. |
#328 fixed issue for me - lora successfully resized. i was able to extract more than 320 dimension after recent update, so decided to try out resizing :) thanks a lot! i'll try with 5-15 to compare result |
activating extra network lora with arguments [<modules.extra_networks.ExtraNetworkParams object at 0x292773760>]: RuntimeError im having the same problem I did extract a Lora from (My own face)x(1.5) trained checkpoint and its so big so idid do the extract method but when I load the Lora im having this problem. |
hello :) thanks for your efforts and work :)
first of all i am extracting LoRA from custom checkpoint (SD-2.x) using
extract_lora_from_models.py
after i am trying to resize LoRA for purpose of reducing "useless noise" using
resize_lora.py
after executing command i am getting error
IndexError: index 320 is out of bounds for dimension 0 with size 320
what i am doing wrong?
environment
OS: archlinux
pytorch: 1.13.1
python: 3.10.10
custom checkpoint: https://civitai.com/models/3452/ultraskin
The text was updated successfully, but these errors were encountered: