mmcls.apis.init_model¶
- mmcls.apis.init_model(config, checkpoint=None, device=None, **kwargs)[源代码]¶
从配置文件初始化一个分类器
- 参数
config (str |
mmengine.Config
) – Config file path or the config object.checkpoint (str, optional) – Checkpoint path. If left as None, the model will not load any weights.
device (str | torch.device | None) – Transfer the model to the target device. Defaults to None.
**kwargs – Other keyword arguments of the model config.
- 返回
The constructed model.
- 返回类型
nn.Module