See our collection for all versions of ConvMixer.

Run ConvMixer with Keras 3: JAX, PyTorch, or TensorFlow

GitHub Docs Collection

zeromodels/convmixer_1024_20_ks9_p14_in1k

Paper: Patches Are All You Need? (arXiv:2201.09792) · HF Papers

ConvMixer applies depthwise and pointwise convolutions on patches in an isotropic stack. Classifier or single-scale backbone.

For more details on the model, please go to the upstream model card.

Pure-Keras 3 conversion of timm/convmixer_1024_20_ks9_p14.in1k for zeromodels. One implementation runs unmodified on TensorFlow / Torch / JAX.

This is an image-classification / backbone checkpoint (ConvMixerImageClassify / ConvMixerModel).

✨ Quick start

import os

os.environ["KERAS_BACKEND"] = "torch"  # or "jax" / "tensorflow"

from PIL import Image
from zeromodels.models.convmixer import ConvMixerImageClassify, ConvMixerModel, ConvMixerImageProcessor

model = ConvMixerImageClassify.from_weights("zeromodels/convmixer_1024_20_ks9_p14_in1k")
processor = ConvMixerImageProcessor.from_weights("zeromodels/convmixer_1024_20_ks9_p14_in1k")

image = Image.open("your_image.jpg").convert("RGB")
pixels = processor(image)  # resize + normalize (normalization lives in the processor)
logits = model(pixels, training=False)
print(logits.shape)  # (1, num_classes)

# Feature extraction: the backbone without the classifier head
backbone = ConvMixerModel.from_weights("zeromodels/convmixer_1024_20_ks9_p14_in1k", as_backbone=True)
features = backbone(pixels, training=False)

Load any ConvMixer variant the same way with from_weights("zeromodels/<variant>"):

Variant Hub
convmixer_1024_20_ks9_p14_in1k zeromodels/convmixer_1024_20_ks9_p14_in1k
convmixer_1536_20_in1k zeromodels/convmixer_1536_20_in1k
convmixer_768_32_in1k zeromodels/convmixer_768_32_in1k

Tips

  • Set KERAS_BACKEND before importing Keras / zeromodels.
  • ConvMixerImageClassify returns class logits; ConvMixerModel returns features (as_backbone=True for multi-scale stages).
  • See docs and Loading Weights.
  • Upstream / timm checkpoints: ConvMixerImageClassify.from_weights("hf:timm/convmixer_1024_20_ks9_p14.in1k").

Special Thanks

A huge thank you to the ConvMixer authors and the timm / Hub communities for creating and releasing these models.

License: see YAML license (usually matches the upstream checkpoint).

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for zeromodels/convmixer_1024_20_ks9_p14_in1k

Finetuned
(1)
this model

Collection including zeromodels/convmixer_1024_20_ks9_p14_in1k

Paper for zeromodels/convmixer_1024_20_ks9_p14_in1k