(pretrained=None, **kwargs)
| 401 | return out_dict |
| 402 | |
| 403 | def tiny(pretrained=None, **kwargs): |
| 404 | model = VisionTransformer( |
| 405 | patch_size=16, embed_dim=192, depth=12, num_heads=3, mlp_ratio=4, qkv_bias=True, |
| 406 | norm_layer=partial(nn.LayerNorm, eps=1e-6)) |
| 407 | if pretrained: |
| 408 | # checkpoint = torch.load('deit_tiny_patch16_224-a1311bcf.pth', map_location="cpu") |
| 409 | # checkpoint = torch.hub.load_state_dict_from_url( |
| 410 | # url="https://dl.fbaipublicfiles.com/deit/deit_tiny_patch16_224-a1311bcf.pth", |
| 411 | # map_location="cpu", check_hash=True |
| 412 | # ) |
| 413 | checkpoint = torch.load(pretrained, map_location="cpu") |
| 414 | model.load_state_dict(checkpoint["model"], strict=True) |
| 415 | return model, 192 |
| 416 | |
| 417 | |
| 418 | def small(pretrained=None, **kwargs): |
no test coverage detected