Shortcuts

PickleDataHook

class mmedit.engine.hooks.PickleDataHook(output_dir, data_name_list, interval=- 1, before_run=False, after_run=False, filename_tmpl='iter_{}.pkl')[source]

Pickle Useful Data Hook.

This hook will be used in SinGAN training for saving some important data that will be used in testing or inference.

Parameters
  • output_dir (str) – The output path for saving pickled data.

  • data_name_list (list[str]) – The list contains the name of results in outputs dict.

  • interval (int) – The interval of calling this hook. If set to -1, the PickleDataHook will not be called during training. Default: -1.

  • before_run (bool, optional) – Whether to save before running. Defaults to False.

  • after_run (bool, optional) – Whether to save after running. Defaults to False.

  • filename_tmpl (str, optional) – Format string used to save images. The output file name will be formatted as this args. Defaults to ‘iter_{}.pkl’.

after_run(runner)[source]

The behavior after each train iteration.

Parameters

runner (object) – The runner.

after_train_iter(runner, batch_idx: int, data_batch: Optional[Sequence[dict]] = None, outputs: Optional[dict] = None)[source]

The behavior after each train iteration.

Parameters
  • runner (Runner) – The runner of the training process.

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

  • data_batch (Sequence[dict], optional) – Data from dataloader. Defaults to None.

  • outputs (dict, optional) – Outputs from model. Defaults to None.

before_run(runner)[source]

The behavior after each train iteration.

Parameters

runner (object) – The runner.

Read the Docs v: zyh/doc-notfound-extend
Versions
master
latest
stable
zyh-doc-notfound-extend
Downloads
pdf
html
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.