mirror of
https://github.com/kohya-ss/sd-scripts.git
synced 2026-04-09 06:45:09 +00:00
Fix unset or invalid LR from making a param_group
This commit is contained in:
@@ -412,8 +412,8 @@ class DyLoRANetwork(torch.nn.Module):
|
||||
text_encoder_lr,
|
||||
unet_lr,
|
||||
default_lr,
|
||||
unet_loraplus_ratio=None,
|
||||
text_encoder_loraplus_ratio=None,
|
||||
unet_loraplus_ratio=None,
|
||||
loraplus_ratio=None
|
||||
):
|
||||
self.requires_grad_(True)
|
||||
@@ -441,7 +441,7 @@ class DyLoRANetwork(torch.nn.Module):
|
||||
else:
|
||||
param_data["lr"] = lr
|
||||
|
||||
if ("lr" in param_data) and (param_data["lr"] == 0):
|
||||
if param_data.get("lr", None) == 0 or param_data.get("lr", None) is None:
|
||||
continue
|
||||
|
||||
params.append(param_data)
|
||||
|
||||
Reference in New Issue
Block a user