Skip to content
fn

resnest_50_cls

→ResNeStForImageClassification27.5M
resnest_50_cls(pretrained: bool | str = False, weights: ResNeSt50Weights | None = None, overrides: object = {})

ResNeSt-50 image classifier (backbone + GAP + linear head).

Builds a ResNeStForImageClassification with the canonical ResNeSt-50 backbone ([3, 4, 6, 3], radix = 2) followed by global average pooling and a linear projection. Approximately 27.5M parameters and 81.1% ImageNet-1k top-1 accuracy in Zhang et al., 2022 (Table 4) — the canonical ResNeSt configuration.

Model Size

Parameters

pretrainedbool or str= False
Pretrained-weight selector. False → random init; True → the DEFAULT tag (ResNeSt50Weights.IN1K); a tag string → that specific checkpoint. Mutually exclusive with weights (which wins if both are given).
weights(ResNeSt50Weights, optional, keyword - only)= None
Explicit weights enum member. Takes precedence over pretrained.
**overridesobject= {}
Keyword overrides forwarded into ResNeStConfig (typically num_classes to retarget the classifier).

Returns

ResNeStForImageClassification

Classifier with the ResNeSt-50 configuration applied (or with overrides merged on top of it).

Notes

See Zhang et al., "ResNeSt: Split-Attention Networks", CVPR Workshops 2022 (arXiv:2004.08955), Table 4. Pretrained weights are converted from timm's resnest50d.in1k and hosted under lucid-dl/resnest-50.

Examples

>>> import lucid
>>> from lucid.models.vision.resnest import resnest_50_cls
>>> model = resnest_50_cls(num_classes=10)
>>> x = lucid.randn(2, 3, 224, 224)
>>> out = model(x)
>>> out.logits.shape
(2, 10)

Used by 1