Skip to content

Question about model save strategy #15

Description

@svjack

The model save strategy in project defined by

            for i, l in enumerate(avg_loss):
                print(f"Unet {i} avg validation loss: ", l)
                if l < best_loss[i]:
                    best_loss[i] = l
                    with training_dir("state_dicts"):
                        model_path = f"unet_{i}_state_{timestamp}.pth"
                        torch.save(imagen.unets[i].state_dict(), model_path)

This may make an inconsistency when unet_0's loss decrease and unet_1 not
i.e. the final saved unet model come from two different model in different training stage.
Does this not have bad effect ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions