Shortcuts

DDPStrategy

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

Distribution strategy for distributed data parallel training.

参数:
  • 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)[源代码]

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

参数:

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

返回:

Converted model.

返回类型:

nn.Module

save_checkpoint(filename, *, save_optimizer=True, save_param_scheduler=True, extra_ckpt=None, callback=None)[源代码]

Save checkpoint to given filename.

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

  • save_optimizer (bool) –

  • save_param_scheduler (bool) –

  • extra_ckpt (dict | None) –

  • callback (Callable | None) –

关键字参数:
  • 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.

返回类型:

None

Read the Docs v: stable
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
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.