-
-
Notifications
You must be signed in to change notification settings - Fork 692
Improve usage of contrib common methods with other save handlers #1123
Copy link
Copy link
Closed
Labels
Description
🚀 Feature
Currently, methods like common.save_best_model_by_val_score and common.setup_common_training_handlers work with local storage setup by output_path.
If we would like to use other save handlers than DiskSaver, it is almost impossible to use those helpers.
Idea is to be able user's setup of save handler for internal Checkpoint class.
There can be several ways, I see, how to accomplish that:
- make
output_pathaccept instances ofBaseSaveHandler
from ignite.contrib.engines import common
save_handler = TrainsSaver(dirname=output_path)
common.save_best_model_by_val_score(
save_handler, evaluator, model=model, metric_name="accuracy", n_saved=3, trainer=trainer, tag="test"
)- set module-wise default save handler as DiskSaver and allow user to replace it by another save hander:
from ignite.contrib.engines import common
common.default_save_handler = TrainsSaver(dirname=output_path)
common.save_best_model_by_val_score(
None, evaluator, model=model, metric_name="accuracy", n_saved=3, trainer=trainer, tag="test"
)- add another argument
save_handler=None
save_handler = TrainsSaver(dirname=output_path)
common.save_best_model_by_val_score(
None, evaluator, model=model, metric_name="accuracy", n_saved=3, trainer=trainer, tag="test", save_handler=save_handler
)Any other ideas @sdesrozis @erip ?
Reactions are currently unavailable