Shortcuts

mmedit.engine.runner.log_processor

Module Contents

Classes

GenLogProcessor

GenLogProcessor inherits from mmengine.runner.LogProcessor and

class mmedit.engine.runner.log_processor.GenLogProcessor(window_size=10, by_epoch=True, custom_cfg: Optional[List[dict]] = None, num_digits: int = 4)[source]

Bases: mmengine.runner.LogProcessor

GenLogProcessor inherits from mmengine.runner.LogProcessor and overwrites self.get_log_after_iter().

This log processor should be used along with mmedit.engine.runner.GenValLoop and mmedit.engine.runner.GenTestLoop.

get_log_after_iter(runner, batch_idx: int, mode: str) Tuple[dict, str][source]

Format log string after training, validation or testing epoch.

If mode is in ‘val’ or ‘test’, we use runner.val_loop.total_length and runner.test_loop.total_length as the total number of iterations shown in log. If you want to know how total_length is calculated, please refers to mmedit.engine.runner.GenValLoop.run() and mmedit.engine.runner.GenTestLoop.run().

Parameters
  • runner (Runner) – The runner of training phase.

  • batch_idx (int) – The index of the current batch in the current loop.

  • mode (str) – Current mode of runner, train, test or val.

Returns

Formatted log dict/string which will be

recorded by runner.message_hub and runner.visualizer.

Return type

Tuple(dict, str)

get_log_after_epoch(runner, batch_idx: int, mode: str) Tuple[dict, str][source]

Format log string after validation or testing epoch.

We use runner.val_loop.total_length and runner.test_loop.total_length as the total number of iterations shown in log. If you want to know how total_length is calculated, please refers to mmedit.engine.runner.GenValLoop.run() and mmedit.engine.runner.GenTestLoop.run().

Parameters
  • runner (Runner) – The runner of validation/testing phase.

  • batch_idx (int) – The index of the current batch in the current loop.

  • mode (str) – Current mode of runner.

Returns

Formatted log dict/string which will be recorded by runner.message_hub and runner.visualizer.

Return type

Tuple(dict, str)

Read the Docs v: latest
Versions
master
latest
stable
zyh-re-docs
zyh-doc-notfound-extend
zyh-api-rendering
Downloads
pdf
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.