openvinotoolkit / anomalib

An anomaly detection library comprising state-of-the-art algorithms and features such as experiment management, hyper-parameter optimization, and edge inference.
https://anomalib.readthedocs.io/en/latest/
Apache License 2.0
3.57k stars 646 forks source link

📚 v1 - Docs Add the feature to resume training from a previous training #1558

Open shrinand1996 opened 8 months ago

shrinand1996 commented 8 months ago

What is the motivation for this task?

It will be great if we can resume training (for EfficientNet) since it takes time to train. Loading the pre trained weight will help get to desired accuracy quicker .

Describe the solution you'd like

An option in the config file that can load the pre trained weight and then resume training from there.

Additional context

No response

blaz-r commented 7 months ago

Hello. You can achieve this by adding resume_from_checkpoint somewhere in your config and providing a path to weights that you want to resume from.

This is not that well documented I thing. So I'll note it down as something that should be improved in v1 docs.

samet-akcay commented 7 months ago

Yes, let's keep this issue open as a doc improvement.

Shakib-IO commented 5 months ago

Hi @samet-akcay @blaz-r I want to work on this.

samet-akcay commented 5 months ago

@Shakib-IO, sure go ahead. Thanks for your interest!

Shakib-IO commented 5 months ago

Hi @blaz-r I'm unsure where I should insert resume_from_checkpoint in the documentation. Any insight you could provide would be greatly appreciated. I found a relevant source here.

Thanks!

blaz-r commented 5 months ago

Hi @Shakib-IO resume_from_checkpoint was part of config before the v1. With v1, this is a bit different. You can pass the checkpoint to fit directly: https://github.com/openvinotoolkit/anomalib/blob/34b3a90f9794dc037ec963381866d18f5f270328/src/anomalib/engine/engine.py#L462-L497 so passing --ckpt_path CKPT_PATH. As for setting this via config, I am not sure how this exactly it's handled there.

ashwinvaidya17 commented 3 months ago

@Shakib-IO are you still working on this?

Shakib-IO commented 3 months ago

No. @ashwinvaidya17