Skip to content

Start higher resolution training from a lower resolution checkpoint - #104

Merged
harisreedhar merged 4 commits into
nextfrom
multi-resolution-part3
Oct 9, 2026
Merged

harisreedhar merged 4 commits into
nextfrom
multi-resolution-part3

Conversation

@harisreedhar

Copy link
Copy Markdown
Collaborator

Adds initial_path to [training.model]. When there is no checkpoint to resume, training first loads the generator weights from initial_path. This lets 512 and 1024 training start from a trained 256 model instead of from scratch.

@harisreedhar
harisreedhar requested a review from henryruhs October 9, 2026 10:42

@henryruhs henryruhs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the custom load initial weights is off - also where it is located in the config

Comment thread hyperswap/README.md Outdated
loss_embedder_path = .models/arcface.pt
face_masker_path = .models/face_masker.pt
face_aligner_path = .models/face_aligner.pt
initial_path =

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should not be empty in READM.md - it has to explain how to use it

Comment thread hyperswap/config.ini Outdated
loss_embedder_path =
face_masker_path =
face_aligner_path =
initial_path =

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this are helper models, I doubt initial_path belongs here

Comment thread hyperswap/tests/helper.py Outdated
from configparser import ConfigParser


def create_test_config_parser(output_size : int) -> ConfigParser:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unrelated test, also what does it test accept ConfigParser? for me this is pointless

Comment thread hyperswap/tests/test_networks.py Outdated
target_generator = Generator(create_test_config_parser(output_size))
source_state = source_generator.state_dict()
target_state = target_generator.state_dict()
initial_keys = []

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keys seems to be wrong wording, ain't this layers name?

Comment thread hyperswap/src/training.py Outdated
)


def load_initial_weights(hyperswap_trainer : HyperSwapTrainer, initial_path : str) -> None:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not understand why this exist, initial weights are supported by lightning

model = MyLightningModule.load_from_checkpoint(
    checkpoint_path="initial_weights.ckpt",
    strict=False  # Ignores missing or extra keys automatically
)

or

trainer = Trainer(resume_from_checkpoint="path/to/your/checkpoint.ckpt")
trainer.fit(model)

https://lightning.ai/docs/fabric/stable/reference/advanced/model_init#loading-checkpoints-for-inference-or-finetuning

@harisreedhar
harisreedhar merged commit ea67ebc into next Oct 9, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants