mirror of
https://github.com/kohya-ss/sd-scripts.git
synced 2026-04-09 06:45:09 +00:00
some log output to print
This commit is contained in:
@@ -20,16 +20,16 @@ def main(file):
|
|||||||
for key in keys:
|
for key in keys:
|
||||||
if "lora_up" in key or "lora_down" in key:
|
if "lora_up" in key or "lora_down" in key:
|
||||||
values.append((key, sd[key]))
|
values.append((key, sd[key]))
|
||||||
logger.info(f"number of LoRA modules: {len(values)}")
|
print(f"number of LoRA modules: {len(values)}")
|
||||||
|
|
||||||
if args.show_all_keys:
|
if args.show_all_keys:
|
||||||
for key in [k for k in keys if k not in values]:
|
for key in [k for k in keys if k not in values]:
|
||||||
values.append((key, sd[key]))
|
values.append((key, sd[key]))
|
||||||
logger.info(f"number of all modules: {len(values)}")
|
print(f"number of all modules: {len(values)}")
|
||||||
|
|
||||||
for key, value in values:
|
for key, value in values:
|
||||||
value = value.to(torch.float32)
|
value = value.to(torch.float32)
|
||||||
logger.info(f"{key},{str(tuple(value.size())).replace(', ', '-')},{torch.mean(torch.abs(value))},{torch.min(torch.abs(value))}")
|
print(f"{key},{str(tuple(value.size())).replace(', ', '-')},{torch.mean(torch.abs(value))},{torch.min(torch.abs(value))}")
|
||||||
|
|
||||||
|
|
||||||
def setup_parser() -> argparse.ArgumentParser:
|
def setup_parser() -> argparse.ArgumentParser:
|
||||||
|
|||||||
Reference in New Issue
Block a user