RuntimeInfoHook¶
- class mmengine.hooks.RuntimeInfoHook[source]¶
A hook that updates runtime information into message hub.
E.g.
epoch
,iter
,max_epochs
, andmax_iters
for the training state. Components that cannot access the runner can get runtime information through the message hub.- after_test(runner)[source]¶
All subclasses should override this method, if they need any operations after testing.
- Parameters:
runner (Runner) – The runner of the testing process.
- Return type:
None
- after_test_epoch(runner, metrics=None)[source]¶
All subclasses should override this method, if they need any operations after each test epoch.
- after_train(runner)[source]¶
All subclasses should override this method, if they need any operations after train.
- Parameters:
runner (Runner) – The runner of the training process.
- Return type:
None
- after_train_iter(runner, batch_idx, data_batch=None, outputs=None)[source]¶
Update
log_vars
in model outputs every iteration.
- after_val(runner)[source]¶
All subclasses should override this method, if they need any operations after validation.
- Parameters:
runner (Runner) – The runner of the validation process.
- Return type:
None
- after_val_epoch(runner, metrics=None)[source]¶
All subclasses should override this method, if they need any operations after each validation epoch.
- before_run(runner)[source]¶
Update metainfo.
- Parameters:
runner (Runner) – The runner of the training process.
- Return type:
None
- before_test(runner)[source]¶
All subclasses should override this method, if they need any operations before testing.
- Parameters:
runner (Runner) – The runner of the testing process.
- Return type:
None
- before_train(runner)[source]¶
Update resumed training state.
- Parameters:
runner (Runner) – The runner of the training process.
- Return type:
None
- before_train_epoch(runner)[source]¶
Update current epoch information before every epoch.
- Parameters:
runner (Runner) – The runner of the training process.
- Return type:
None