MCPcopy Create free account
hub / github.com/OpenDriveLab/ReSim / small_dWr

Function small_dWr

SwissArmyTransformer/examples/yolos/models/backbone.py:433–442  ·  view source on GitHub ↗
(pretrained=None, **kwargs)

Source from the content-addressed store, hash-verified

431
432
433def small_dWr(pretrained=None, **kwargs):
434 model = VisionTransformer(
435 img_size=240,
436 patch_size=16, embed_dim=330, depth=14, num_heads=6, mlp_ratio=4, qkv_bias=True,
437 norm_layer=partial(nn.LayerNorm, eps=1e-6), **kwargs)
438 if pretrained:
439 # checkpoint = torch.load('fa_deit_ldr_14_330_240.pth', map_location="cpu")
440 checkpoint = torch.load(pretrained, map_location="cpu")
441 model.load_state_dict(checkpoint["model"], strict=False)
442 return model, 330
443
444
445def base(pretrained=None, **kwargs):

Callers 1

__init__Method · 0.85

Calls 3

VisionTransformerClass · 0.85
loadMethod · 0.45
load_state_dictMethod · 0.45

Tested by

no test coverage detected