(pretrained=None, **kwargs)
| 443 | |
| 444 | |
| 445 | def base(pretrained=None, **kwargs): |
| 446 | model = VisionTransformer( |
| 447 | img_size=384, patch_size=16, embed_dim=768, depth=12, num_heads=12, mlp_ratio=4, qkv_bias=True, |
| 448 | norm_layer=partial(nn.LayerNorm, eps=1e-6),is_distill=True, **kwargs) |
| 449 | if pretrained: |
| 450 | # checkpoint = torch.load('deit_base_distilled_patch16_384-d0272ac0.pth', map_location="cpu") |
| 451 | # checkpoint = torch.hub.load_state_dict_from_url( |
| 452 | # url="https://dl.fbaipublicfiles.com/deit/deit_base_distilled_patch16_384-d0272ac0.pth", |
| 453 | # map_location="cpu", check_hash=True |
| 454 | # ) |
| 455 | checkpoint = torch.load(pretrained, map_location="cpu") |
| 456 | model.load_state_dict(checkpoint["model"], strict=False) |
| 457 | return model, 768 |
no test coverage detected