Skip to content
fn

resnext_101_32x8d_cls

→ResNeXtForImageClassification
resnext_101_32x8d_cls(pretrained: bool | str = False, weights: ResNeXt101_32x8dWeights | None = None, overrides: object = {})

ResNeXt-101 (32x8d) image classifier (backbone + GAP + linear head).

Builds a ResNeXtForImageClassification with the high-capacity ResNeXt-101 (32x8d) topology and a lucid.nn.Linear classifier projecting 2048 → config.num_classes. Approximately 88.8 M parameters; the distributed IMAGENET1K_V2 checkpoint reaches 82.834% ImageNet-1k top-1 with the improved training recipe.

Model Size

Parameters

pretrainedbool or str= False
Pretrained-weight selector. False → random init; True → the DEFAULT tag (ResNeXt101_32x8dWeights.IMAGENET1K_V2); a tag string (e.g. "IMAGENET1K_V2") → that specific checkpoint. Mutually exclusive with weights (which wins if both are given).
weights(ResNeXt101_32x8dWeights, optional, keyword - only)= None
Explicit weights enum member, e.g. ResNeXt101_32x8dWeights.IMAGENET1K_V2. Takes precedence over pretrained.
**overridesobject= {}
Keyword overrides forwarded into ResNeXtConfig. Note: overriding num_classes away from the checkpoint's class count makes pretrained loading fail the strict key/shape check.

Returns

ResNeXtForImageClassification

Classifier with the ResNeXt-101 (32x8d) configuration applied (or with overrides merged on top of it), optionally initialised from pretrained weights.

Notes

See Xie et al., "Aggregated Residual Transformations for Deep Neural Networks", CVPR 2017. Pretrained weights are converted from reference_vision's ResNeXt101_32X8D_Weights.IMAGENET1K_V2 and hosted on the Hugging Face Hub under lucid-dl/resnext-101-32x8d. The V2 preset uses a 232 resize ahead of the 224 center crop.

Examples

>>> import lucid
>>> from lucid.models.vision.resnext import resnext_101_32x8d_cls
>>> model = resnext_101_32x8d_cls()
>>> x = lucid.randn(1, 3, 224, 224)
>>> out = model(x)
>>> out.logits.shape
(1, 1000)
Load ImageNet-pretrained weights:
>>> model = resnext_101_32x8d_cls(pretrained=True)
>>> from lucid.models.vision.resnext import ResNeXt101_32x8dWeights
>>> model = resnext_101_32x8d_cls(weights=ResNeXt101_32x8dWeights.IMAGENET1K_V2)

Used by 1