rockerBOO / lora-inspector

LoRA (Low-Rank Adaptation) inspector for Stable Diffusion
MIT License
80 stars 4 forks source link

Gives this with -w #7

Closed Toshik-One closed 1 year ago

Toshik-One commented 1 year ago

Please submit the following keys so we can get a parser made for it: dict_keys(['format']) model key count: 1145 Traceback (most recent call last): File "/content/lora-inspector/lora-inspector.py", line 397, in results = process(args) File "/content/lora-inspector/lora-inspector.py", line 372, in process return process_safetensor_file(file, args) File "/content/lora-inspector/lora-inspector.py", line 262, in process_safetensor_file find_vectors_weights(f) File "/content/lora-inspector/lora-inspector.py", line 175, in find_vectors_weights avg_mag = sum_mag / num_results ZeroDivisionError: division by zero

rockerBOO commented 1 year ago

Hmm is it possible that this LoRA doesn't have a UNet trained? I can look into fixing it so it won't error but curious.

Toshik-One commented 1 year ago

this LoRA https://civitai.com/models/48139/lowra

rockerBOO commented 1 year ago

Hmm seems to work on my end. Maybe download it again to confirm it is all there? I will still look into the missing UNet because that's a thing that should be supported.

python lora-inspector.py -w  /mnt/900/lora/LowRA.safetensors
/mnt/900/lora/LowRA.safetensors
model key count: 792
UNet attention weight average magnitude: 2.6101634470841035
UNet attention weight average strength: 0.010605590754123827
Text Encoder weight average magnitude: 2.3996765103651425
Text Encoder weight average strength: 0.008541954607252404
Toshik-One commented 1 year ago

This happened to me too after a restart. But to save the meta data did not work.

rockerBOO commented 1 year ago

Seems those LoRA's do not have any metadata. I fixed them so they will still go through the process but the result will limited.

{"file": "/mnt/900/lora/LowRA.safetensors", "filename": "LowRA.safetensors"}

Also fixed missing UNet which should pass through fine now.

Thanks for reporting! Let me know if you have any issues with these.