mirror of
https://github.com/kohya-ss/sd-scripts.git
synced 2026-04-09 06:45:09 +00:00
pop weights if available #1247
This commit is contained in:
@@ -481,7 +481,8 @@ class NetworkTrainer:
|
|||||||
if not isinstance(model, type(accelerator.unwrap_model(network))):
|
if not isinstance(model, type(accelerator.unwrap_model(network))):
|
||||||
remove_indices.append(i)
|
remove_indices.append(i)
|
||||||
for i in reversed(remove_indices):
|
for i in reversed(remove_indices):
|
||||||
weights.pop(i)
|
if len(weights) > i:
|
||||||
|
weights.pop(i)
|
||||||
# print(f"save model hook: {len(weights)} weights will be saved")
|
# print(f"save model hook: {len(weights)} weights will be saved")
|
||||||
|
|
||||||
def load_model_hook(models, input_dir):
|
def load_model_hook(models, input_dir):
|
||||||
|
|||||||
Reference in New Issue
Block a user