def __init__(self, cfg, model_cfg, num_classes, **kwargs):
    super().__init__()
    self.backbone = build_backbone(model_cfg.BACKBONE.NAME, verbose=cfg.VERBOSE, pretrained=model_cfg.BACKBONE.PRETRAINED, **kwargs)
    fdim = self.backbone.out_features
    print('------------------------fdim:', fdim)
    self.head = None
    if (model_cfg.HEAD.NAME and model_cfg.HEAD.HIDDEN_LAYERS):
        self.head = build_head(model_cfg.HEAD.NAME, verbose=cfg.VERBOSE, in_features=fdim, hidden_layers=model_cfg.HEAD.HIDDEN_LAYERS, activation=model_cfg.HEAD.ACTIVATION, bn=model_cfg.HEAD.BN, dropout=model_cfg.HEAD.DROPOUT, **kwargs)
        fdim = self.head.out_features
    self.classifier = None
    if (num_classes > 0):
        self.classifier = nn.Linear(fdim, num_classes)
    self._fdim = fdim
def __init__(self, cfg, model_cfg, num_classes, **kwargs):
    super().__init__()
    self.backbone = build_backbone(model_cfg.BACKBONE.NAME, verbose=cfg.VERBOSE, pretrained=model_cfg.BACKBONE.PRETRAINED, **kwargs)
    fdim = self.backbone.out_features
    print('------------------------fdim:', fdim)
    self.head = None
    if (model_cfg.HEAD.NAME and model_cfg.HEAD.HIDDEN_LAYERS):
        self.head = build_head(model_cfg.HEAD.NAME, verbose=cfg.VERBOSE, in_features=fdim, hidden_layers=model_cfg.HEAD.HIDDEN_LAYERS, activation=model_cfg.HEAD.ACTIVATION, bn=model_cfg.HEAD.BN, dropout=model_cfg.HEAD.DROPOUT, **kwargs)
        fdim = self.head.out_features
    self.classifier = None
    if (num_classes > 0):
        self.classifier = nn.Linear(fdim, num_classes)
    self._fdim = fdim