Пример #1
0
def transt_resnet50(settings):
    num_classes = 1
    backbone_net = build_backbone(settings, backbone_pretrained=True)
    featurefusion_network = build_featurefusion_network(settings)
    model = TransT(backbone_net,
                   featurefusion_network,
                   num_classes=num_classes)
    device = torch.device(settings.device)
    model.to(device)
    return model
Пример #2
0
def transt_resnet50(settings):
    num_classes = 1
    backbone_net = build_backbone(settings, backbone_pretrained=True)
    featurefusion_network = build_featurefusion_network(settings)
    model = TransT(backbone_net,
                   featurefusion_network,
                   num_classes=num_classes)
    device = torch.device(settings.device)
    model.to(device)
    # if hasattr(settings, "init_ckpt") and settings.init_ckpt:
    #     print("Initializing from settings.init_ckpt")
    #     model = load_weights(model, settings.init_ckpt, strict=True)
    return model
Пример #3
0
def transt_resnet50(settings):
    num_classes = 1
    backbone_net = build_backbone(settings, backbone_pretrained=True)
    featurefusion_network = build_featurefusion_network(settings)
    model = TransT(backbone_net,
                   featurefusion_network,
                   num_classes=num_classes)
    device = torch.device(settings.device)
    model.to(device)
    if settings.init_ckpt:
        print("Initializing from settings.init_ckpt")
        model = load_weights(
            model, settings.init_ckpt,
            strict=False)  # Not strict so we can add to the model
    return model