Shortcuts

DDPStrategy

class mmengine._strategy.DDPStrategy(*, model_wrapper=None, sync_bn=None, **kwargs)[source]

Distribution strategy for distributed data parallel training.

Parameters:
  • model_wrapper (dict) – Dict for model wrapper. Defaults to None.

  • sync_bn (str) – Type of sync batch norm. Defaults to None. Options are ‘torch’ and ‘mmcv’.

  • **kwargs – Other arguments for BaseStrategy.

convert_model(model)[source]

convert all BatchNorm layers in the model to SyncBatchNorm (SyncBN) or mmcv.ops.sync_bn.SyncBatchNorm (MMSyncBN) layers.

Parameters:

model (nn.Module) – Model to be converted.

Returns:

Converted model.

Return type:

nn.Module

save_checkpoint(filename, *, save_optimizer=True, save_param_scheduler=True, extra_ckpt=None, callback=None)[source]

Save checkpoint to given filename.

Parameters:
  • filename (str) – Filename to save checkpoint.

  • save_optimizer (bool) –

  • save_param_scheduler (bool) –

  • extra_ckpt (dict | None) –

  • callback (Callable | None) –

Keyword Arguments:
  • save_optimizer (bool) – Whether to save the optimizer to the checkpoint. Defaults to True.

  • save_param_scheduler (bool) – Whether to save the param_scheduler to the checkpoint. Defaults to True.

  • extra_ckpt (dict, optional) – Extra checkpoint to save. Defaults to None.

  • callback (callable, callable) – Callback function to modify the checkpoint before saving the checkpoint. Defaults to None.

Return type:

None

Read the Docs v: v0.10.4
Versions
latest
stable
v0.10.4
v0.10.3
v0.10.2
v0.10.1
v0.10.0
v0.9.1
v0.9.0
v0.8.5
v0.8.4
v0.8.3
v0.8.2
v0.8.1
v0.8.0
v0.7.4
v0.7.3
v0.7.2
v0.7.1
v0.7.0
v0.6.0
v0.5.0
v0.4.0
v0.3.0
v0.2.0
Downloads
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.