Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate initializing from checkpoint #332

Closed
hvgazula opened this issue May 10, 2024 · 3 comments
Closed

Integrate initializing from checkpoint #332

hvgazula opened this issue May 10, 2024 · 3 comments
Assignees

Comments

@hvgazula
Copy link
Contributor

Currently, the model needs to be explicitly initialized from a checkpoint. Otherwise, training starts from scratch.

aha-

Resumption works always (if called as follows)

 bem = Segmentation.init_with_checkpoints(
            unet,
            model_args=dict(batchnorm=True),
            checkpoint_filepath="000-toy",
        )

 print("training")
    _ = bem.fit(
        dataset_train=dataset_train,
        dataset_validate=dataset_eval,
        epochs=n_epochs,
        callbacks=callbacks,
    )

Resumption fails (starts from scratch)

 bem = Segmentation(
            unet,
            model_args=dict(batchnorm=True),
            multi_gpu=True,
            checkpoint_filepath="000-toy",
        )

 print("training")
    _ = bem.fit(
        dataset_train=dataset_train,
        dataset_validate=dataset_eval,
        epochs=n_epochs,
        callbacks=callbacks,
    )

Solution:

  • init_from_checkpoint isn't intuitive 🤔 (being a class method). Call it at estimator instantiation time.
@hvgazula hvgazula self-assigned this May 10, 2024
@hvgazula
Copy link
Contributor Author

For more info #331

@hvgazula
Copy link
Contributor Author

It looks like resumption only works if there's been a SIGINT, otherwise it's starting from scratch.

@hvgazula
Copy link
Contributor Author

Would it make sense to add init_from_checkpoints(...) in init or fitofSegmentation()`? 🤔

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

No branches or pull requests

1 participant