Skip to main content
← Lab

poolmult

confirmedupstream bugPython · timm / PyTorchModel behavior & reasoningJuly 25, 2026

the question

Does timm's NormMlpClassifierHead support the documented catavgmax pooling option?

what came out

timm's NormMlpClassifierHead accepts the catavgmax pool (feat_mult=2) but sizes its norm/fc to the un-doubled in_features, so global_pool='catavgmax' feeds 640 channels into a norm sized for 320 and raises RuntimeError on ConvNeXt/MaxViT/CoAtNet. Siblings handle the doubling; the fix multiplies by feat_mult().

method & receipts

  • Result: confirmed
  • Reproducible one script re-runs the whole thing from scratch.
  • Tested — a correctness/benchmark suite ships alongside the code.

→ read the code and re-run it

github.com/v-code01/poolmult