pytorch-ignite / examples

Examples, tutorials, and how-to guides
BSD 3-Clause "New" or "Revised" License
11 stars 12 forks source link

could you give an example of how to save checkpoints? #47

Closed tomisalready closed 3 years ago

tomisalready commented 3 years ago

unfortunately, as i upgrade the ignite, i don't know how to save my model's checkpoints, becuase the save_interval is deprecated, my code is below, but it doesn' work. checkpointer = ModelCheckpoint(output_dir, cfg.MODEL.NAME, n_saved=10, require_empty=False) trainer.add_event_handler(Events.EPOCH_COMPLETED(every=1), checkpointer, to_save={'model': model, 'optimizer': optimizer})

please give an example, thanks

vfdev-5 commented 3 years ago

Hi @tomisalready can you give ignite version and the error you get ? Thanks

tomisalready commented 3 years ago

i install the pytorch-ignite 0.4.6, but save_interval is deprecated in this version, i want save my trainning checkpoints, there's no example of how to save this. could you offer an example? thanks

vfdev-5 commented 3 years ago

Please check out the docs and tutorials: