Skip to content

Commit

Permalink
Merge pull request kohya-ss#208 from space-nuko/add-optimizer-to-meta…
Browse files Browse the repository at this point in the history
…data

Add optimizer to metadata
  • Loading branch information
kohya-ss authored Feb 19, 2023
2 parents a9d29ac 4e5db58 commit 08ae46b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion train_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 226,8 @@ def train(args):
else:
optimizer_class = torch.optim.AdamW

optimizer_name = optimizer_class.__module__ "." optimizer_class.__name__

trainable_params = network.prepare_optimizer_params(args.text_encoder_lr, args.unet_lr)

# betaやweight decayはdiffusers DreamBoothもDreamBooth SDもデフォルト値のようなのでオプションはとりあえず省略
Expand Down Expand Up @@ -369,7 371,8 @@ def train(args):
"ss_tag_frequency": json.dumps(train_dataset.tag_frequency),
"ss_bucket_info": json.dumps(train_dataset.bucket_info),
"ss_training_comment": args.training_comment, # will not be updated after training
"ss_sd_scripts_commit_hash": train_util.get_git_revision_hash()
"ss_sd_scripts_commit_hash": train_util.get_git_revision_hash(),
"ss_optimizer": optimizer_name
}

# uncomment if another network is added
Expand Down

0 comments on commit 08ae46b

Please sign in to comment.