mmcls.apis.init_model¶ mmcls.apis.init_model(config, checkpoint=None, device='cuda:0', options=None)[源代码]¶ Initialize a classifier from config file. 参数 config (str or 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. options (dict) – Options to override some settings in the used config. 返回 The constructed classifier. 返回类型 nn.Module