Shortcuts

TimeLimit#

class ignite.handlers.TimeLimit(limit_sec=28800)[source]#

TimeLimit handler can be used to control training time for computing environments where session time is limited. Timer starts when handler is created and not training started. This handler gracefully terminates the training if time passed in the training exceeds a limit.

Parameters

limit_sec (Optional[int]) – Maximum time before training terminates (in seconds). Defaults to 28800.

Examples

from ignite.engine import Events
from ignite.handlers import TimeLimit

handler = TimeLimit() # 8 hours of training
trainer.add_event_handler(Events.ITERATION_COMPLETED, handler)

New in version 0.4.3.

Methods